Switch type argument syntax (#1940)
This changes type argument syntax to "standard" style, and away from turbofish. The motivation here is that turbofish-style type arguments are hard to read, and developers who are not already deeply knowledgeable about Pkl might struggle to understand such code. In most languages, the grammar for "method call with type args" don't introduce any additional symbols between the identifier and the type argument list (e.g. C++, TypeScript, C#, Scala, Go).
This commit is contained in:
1 parent
6ad50eb589
commit
a9b7fe3a33
96 files changed
+1448
-376
No files matched your search
+2
-2
@@ -35,7 +35,7 @@ module pkl.ref
|
||||
///
|
||||
/// Example:
|
||||
/// ```
|
||||
/// myReference: Reference<MyDomain, Listing<String>> = Reference::<MyDomain, Listing<String>>(domain, data)
|
||||
/// myReference: Reference<MyDomain, Listing<String>> = Reference<MyDomain, Listing<String>>(domain, data)
|
||||
/// ```
|
||||
external const function Reference<Domain, Type>(
|
||||
domain: Domain(this is AbstractDomain),
|
||||
@@ -153,7 +153,7 @@ external const function Reference<Domain, Type>(
|
||||
/// properties: Mapping<String, String>
|
||||
/// }
|
||||
///
|
||||
/// local outputs: FooReference<Outputs> = ref.Reference::<Foo, Outputs>(new Foo {}, "outputs")
|
||||
/// local outputs: FooReference<Outputs> = ref.Reference<Foo, Outputs>(new Foo {}, "outputs")
|
||||
///
|
||||
/// // Dot access; gives a `Reference<Foo, String>`
|
||||
/// myFile = outputs.file
|
||||
|
||||
@@ -305,7 +305,6 @@ typealias TerminalNodeType =
|
||||
| "assign"
|
||||
| "at"
|
||||
| "colon"
|
||||
| "dcolon"
|
||||
| "comma"
|
||||
| "dot"
|
||||
| "gt"
|
||||
|
||||
Reference in new issue
Block a user