-
-
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
The relative precedence of ::
and where
is strangely context dependent
#55159
Comments
Yes, there's a special case of The fact long form vs short form function definitions are different is quite troubling. We could possibly change the precedence for the short form as well (by detecting the trailing |
Relevant: #21847 |
Thanks. I knew I'd seen Jeff comment about this somewhere (See #21847 (comment)) That old issue was closed because changing parsing is technically breaking. But if we had the mechanism which is being discussed in #54903 we might be able to fix some things which are "technically breaking" but not actually breaking in practice. And even things which are actually breaking (in a minor way), but we'd like to revisit for clarity. I'm willing to bet that - if it was practical to change short-form parsing of function definitions - this would not actually break anything. Because people always want the |
Yes, as it is this was intentional; there is no single ideal option. So I don't consider this a bug but we can consider it a point of language evolution. |
JuliaLang/JuliaSyntax.jl#466 takes a related step toward doing this by changing the parsing of short form functions in the JuliaSyntax AST (this has no affect on |
From conversation with @c42f, the relative precedence of
::
andwhere
is strangely context dependent:This also reproduces on pre-JS versions, but is less unambiguously visible
The text was updated successfully, but these errors were encountered: