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
This seems related to #900, but a different issue.
I was trying to match on a case object in a for comprehension, but it kept matching all elements. I managed to reduce it to the following test case. It seems that even identifiers starting with a capital letter, or surrounded by back-ticks are treated as free variables. (There is no What identifier defined at all).
In brief, "If p is some pattern other than a simple name or a name followed by a colon and a type," then you get pattern-matching behavior for either a val definition or a generator. The generator case falls under refutability, except that, narrowly construed, irrefutability requires a varid.
The alternatively syntaxes (workarounds) are similar in all cases, namely, to change the shape of the pattern.
This seems related to #900, but a different issue.
I was trying to match on a case object in a for comprehension, but it kept matching all elements. I managed to reduce it to the following test case. It seems that even identifiers starting with a capital letter, or surrounded by back-ticks are treated as free variables. (There is no
What
identifier defined at all).I expected these to behave as in a regular pattern match. I get the same result in 2.11.5, 2.11.6, and 2.12.0-M1.
The text was updated successfully, but these errors were encountered: