You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think we have a similar amount of freedom here as we do with identifier<type,arguments> for literals denoting parameterized types (and, coincidentally, generic function instantiations): We can add support for that kind of syntax, and it makes no difference for anything other than the syntax (because the underlying runtime support needs to exist anyway). This would presumably allow us to make that decision independently (no need to hurry).
We would have stuff like {x == int?? 2 : 3} which could be a set (containing 2 if x is int? and otherwise 3) or a map (namely {b: 3} where b is true or false (or 2 if == can return null)), so there's certainly a potential for ambiguities.
In general, yes, I think it would be nice to support all type annotations as type literals. In ambiguous cases, can we simply always prefer the non-type literal interpretation and then if you want the type literal, you parenthesize it?
We would have stuff like {x == int?? 2 : 3}
I think that one is easy because we can and should always lex ?? a single token without doing the magic "split in two only if needed" that we do for >>.
Is the following a syntactically valid post-nnbd program?
cc @lrhn @munificent @eernstg
The text was updated successfully, but these errors were encountered: