-
Notifications
You must be signed in to change notification settings - Fork 9
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
parser: Fix assignability check by tracking type context #296
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
juliaogris
force-pushed
the
const-lit-fix
branch
from
March 15, 2024 01:24
d7bbc35
to
e438760
Compare
firebase-deployment for 9ce064e |
juliaogris
force-pushed
the
const-lit-fix
branch
from
March 15, 2024 01:54
e438760
to
8d1812e
Compare
juliaogris
force-pushed
the
const-lit-fix
branch
from
March 15, 2024 03:03
8d1812e
to
81d97c0
Compare
juliaogris
force-pushed
the
const-lit-fix
branch
from
March 15, 2024 03:04
81d97c0
to
a1deb0b
Compare
juliaogris
force-pushed
the
const-lit-fix
branch
from
March 15, 2024 10:35
a1deb0b
to
ec7f357
Compare
juliaogris
changed the title
parser: Fix const literal check in assignability
parser: Fix assignability check by tracking type context
Mar 15, 2024
juliaogris
force-pushed
the
const-lit-fix
branch
from
March 21, 2024 04:52
ec7f357
to
a88ed7d
Compare
Fix assignability check by tracking type context in Type.Fixed flag: A variable or expression of composite type has its type field Fixed set to true. All other types, including literal composite Types have the Type.Fixed field set to false. This allows the Type.accept(otherType) method to work without the additional, previously used `isConst` parameter, which was also imprecise. We can also remove the `isCompositeConst` and `isConst` functions from the ast.go file. Additionally rework the `combineTypes()` function to work with the new Type.Fixed flag. Add test cases to parser and evaluator package that cover all noted crashes on nested types. Issue: #295
juliaogris
force-pushed
the
const-lit-fix
branch
from
March 21, 2024 05:11
a88ed7d
to
9ce064e
Compare
camh-
approved these changes
Mar 21, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💚
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix assignability check by tracking type context in Type.Fixed flag: A
variable or expression of composite type has its type field Fixed set to
true. All other types, including literal composite Types have the Type.Fixed
field set to false.
This allows the Type.accept(otherType) method to work without the additional,
previously used
isConst
parameter, which was also imprecise. We can alsoremove the
isCompositeConst
andisConst
functions from the ast.go file.Additionally rework the
combineTypes()
function to work with the newType.Fixed flag.
Add test cases to parser and evaluator package that cover all noted crashes on
nested types.
Issue: #295
Fixes #295