Opportunity for better precedence in given
declarations with experimental.modularity
#20364
Labels
stat:needs triage
Every issue needs to have an "area" and "itype" label
Compiler version
Latest
main
,3393f7ea7704eb1dd553c96a805906821c61db5f
.Minimized example
I've found a couple of cases using the new "modularity" syntax where parentheses are required, but where the parser ought to be able to parse unambiguously without.
Assuming a typeclass definition such as,
We cannot write:
We must write,
and likewise for
String
singleton literal types.And with
language.experimental.captureChecking
, the parentheses are also required for:This is just mild friction, though the error messages are not informative. Another related case where parentheses become necessary occurs in pattern matching (typically only in an inline context, because usually erasure obviates matching on the
Self
parameter):An "old-style" typeclass could be matched with,
but the equivalent in "new style" must now be written,
The text was updated successfully, but these errors were encountered: