-
-
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
lost expected assignment after "const"
error
#45024
Labels
parser
Language parsing and surface syntax
regression
Regression in behavior compared to a previous version
Milestone
Comments
JeffBezanson
added
regression
Regression in behavior compared to a previous version
parser
Language parsing and surface syntax
labels
Apr 18, 2022
If we fix this in lowering, there's a chance it could be breaking. We currently allow lowering code containing |
JeffBezanson
added a commit
that referenced
this issue
May 17, 2022
KristofferC
pushed a commit
that referenced
this issue
May 18, 2022
KristofferC
pushed a commit
that referenced
this issue
May 18, 2022
KristofferC
pushed a commit
that referenced
this issue
May 18, 2022
c42f
added a commit
to JuliaLang/JuliaSyntax.jl
that referenced
this issue
Oct 26, 2022
Here I've replicated the fix from JuliaLang/julia#45024 so that `const x` (ie, without an assignment) is only valid within a `struct` and is otherwise an error. Also avoid lowering the syntax `global const` into `const global` within the parser; do this in Expr conversion instead. This more closely reflects the structure of the source, allowing trivia attachment to be more natural.
c42f
added a commit
to JuliaLang/JuliaSyntax.jl
that referenced
this issue
Oct 26, 2022
Here I've replicated the fix from JuliaLang/julia#45024 so that `const x` (ie, without an assignment) is only valid within a `struct` and is otherwise an error. Also avoid lowering the syntax `global const` into `const global` within the parser; do this in `Expr` conversion instead. This more closely reflects the structure of the source, allowing trivia attachment to be more natural.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
parser
Language parsing and surface syntax
regression
Regression in behavior compared to a previous version
These both used to give the "expected assignment" error. This is because we need to parse
const x
inside struct definitions, andconst x
is a valid IR form but not generally allowed as input syntax. We need to either fix the error, or decide to allowconst x
(which declaresx
constant without giving it a value, which is a state we didn't want to be observable for too long).The text was updated successfully, but these errors were encountered: