diff --git a/working/3616 - enum value shorthand/proposal-simple-lrhn.md b/working/3616 - enum value shorthand/proposal-simple-lrhn.md index a19e7449c..442ffcc8d 100644 --- a/working/3616 - enum value shorthand/proposal-simple-lrhn.md +++ b/working/3616 - enum value shorthand/proposal-simple-lrhn.md @@ -37,7 +37,7 @@ We introduce grammar productions of the form: ::= ... -- all current productions | -- No selectors, no `.new`. - ::= + ::= * ::= @@ -91,7 +91,7 @@ Future futures = .wait([lazyString(), lazyString()]).then((list) => list This is a simple grammatical change. It allows new constructs in any place where we currently allow primary expressions followed by selector chains through the `` production ` *`, -and now also ` `. +and now also ` *`. The new grammar is added as a separate production, rather than making `` a ``, and sharing the `*` @@ -163,7 +163,7 @@ First, when inferring types for a `` of the form `` with context type scheme *C*, then assign *C* as the shorthand context of the leading ``. Then continue inferring a type for the entire `` -recursively on the chain of selectors of the ``, +recursively on the chain of selectors of the `*`, in the same way as for a ` *`. _This assigns the context type scheme of the entire, maximal selector chain to the static member shorthand head, moving it past any intermediate ``s._ @@ -266,11 +266,11 @@ like `.parse(input).abs()`, then the recognized expression, `.parse(input)` in this example, likely has no context type._ Expressions of the forms .new\<*typeArgs*\> or -.new\<*typeArgs*\> (as a prefix of a ` *` +.new\<*typeArgs*\>(*args*) (as a prefix of a ` *` production, or the entire chain) are compile-time errors, just like the corresponding *T*.new\<*typeArgs*\> -and *T*.new\<*typeArgs*\> already are, whether used as instantiated -tear-off or invoked. +and *T*.new\<*typeArgs*\>(*args*) already are, whether used as +instantiated tear-off or invoked. _(The grammar allows them, because `C.new` is a `` expression, but a `C.new`, or a `C.id` denoting a constructor, followed by type arguments is recognized and made an error to avoid it being interpreted as `(C.new)`.)_ @@ -317,7 +317,7 @@ For `==`, we special-case when the right operand is (precisely!) a static member shorthand. If an expression has the form `e1 == e2` or `e1 != e2`, or a pattern has the -form `== e2`, where the static type of `e1`, or the matched value type of the +form `== e2` or `!= e2`, where the static type of `e1`, or the matched value type of the pattern, is *S1*, and *e2* is precisely a `` expression, then assign the type *S1* as the shorthand context of the `` of *e2* before inferring its static type the same way as above. @@ -387,7 +387,7 @@ a static declaration or constructor declaration *S* when looked up on *D*. * An expression of the form `.` is a constant expression if *S* declares a corresponding static constant getter. * An expression of the form `.` that is not followed by an - ``, is a constant expression if `*S* declares + ``, is a constant expression if *S* declares a static method or constructor with base name ``, and either type inference has not added type arguments as a generic function instantiation coercion to the method,