-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Syntax ambiguity when range is used in ternary operator #23599
Comments
This is actually expected, since ternaries are parsed more eagerly than ranges. You can see what's actually happening by inspecting the output of
That is, the precedence is |
Which version is this? I don't get these warnings in 0.6. |
I'm not sure it's erroneous output, but rather a case of parsing precedence. |
The output I posted was from the current master, but the parsing is the same across all Julia versions (or at least 0.3-0.7—I don't have 0.2 or lower installed). The deprecation warnings are new though, recent 0.7. |
Can you confirm that these warnings don't show up in 0.6? |
Yes – as a side effect of requiring space after |
The following code produces unexpected output:
of course, it can be fixed by adding braces:
However, I still think it should be deprecated for the same reason that
1.+2 was deprecated. Especially, in light of the fact that it produces erroneous output.
The text was updated successfully, but these errors were encountered: