Symbol syntax is ambiguous with normal property access. #12586
Labels
area-language
Dart language related items (some items might be better tracked at github.com/dart-lang/language).
closed-as-intended
Closed as the reported issue is expected behavior
P1
A high priority bug; for example, a single project is unusable or has many test failures
The new syntax for symbols allows "#foo.bar" as a single symbol literal.
It can also be parsed as the symbol literal "#foo" getting accessed with a "bar" getter. This makes the grammar ambiguous.
I recommend resolving it by disallowing "dotted symbols". In the rare case that you need these (which, if I understand it correctly, is only used for library names), you can use "const Symbol('foo.bar')". The "#foo.bar" notation is too hard to read as being a single literal when you are used to reading ".bar" as a getter access.
The text was updated successfully, but these errors were encountered: