-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected match with disjunction #99
Comments
In case it isn't clear what is happening, there is no link between the two A variable pattern (like Since it is unbound where each |
it is now an error to use it again later in the pattern, or in a value expression. The reason is that the semantics are too confusing. If you get this error, just rename the pattern variable to avoid the conflict, or use a wildcard instead. This is technically a breaking change, but I'm guessing that it will occur only rarely in practice. Therefore I am only bumping the minor version number. Fixes #99
….. (#100) * Adjust tests to reflect changes in Julia 1.11 nightlies. * When a pattern variable is defined on only one side of a disjunction, it is now an error to use it again later in the pattern, or in a value expression. The reason is that the semantics are too confusing. If you get this error, just rename the pattern variable to avoid the conflict, or use a wildcard instead. This is technically a breaking change, but I'm guessing that it will occur only rarely in practice. Therefore I am only bumping the minor version number. Fixes #99
One would expect the following program to behave as described in the comments. Instead, it prints
true
four times.At the very least we should produce a warning for the third
println
, rather than silently behaving in an unexpected way.The text was updated successfully, but these errors were encountered: