-
Notifications
You must be signed in to change notification settings - Fork 225
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
feat(experimental): Implement comptime mut globals #4926
Conversation
span: let_stmt.pattern.span(), | ||
}); | ||
let span = let_stmt.pattern.span(); | ||
self.push_err(ResolverError::AbiAttributeOusideContract { span }); |
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.
Looks like this is an old spelling error. Could we change it to Outside
everywhere
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.
Split this off here: #4933
} | ||
|
||
fn main() { | ||
// Order of comptime evaluation between functions isn't guaranteed |
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.
Can we make this guaranteed? Of course this would be a follow-up
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.
span: let_stmt.pattern.span(), | ||
}); | ||
let span = let_stmt.pattern.span(); | ||
self.push_err(ResolverError::AbiAttributeOusideContract { span }); |
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.
Split this off here: #4933
} | ||
|
||
fn main() { | ||
// Order of comptime evaluation between functions isn't guaranteed |
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.
Description
Problem*
Resolves #4917
Summary*
Implements mutable comptime globals
Additional Context
Changes should be relatively straightforward - mostly parser changes to add parsing
mut
to globals, resolution changes to track this and error if the global is not also comptime, etc. The one bug that was fixed is that globals were being re-evaluated in the interpreter each time which would reset their value whenever they were referenced. This has been fixed with a lookup check.Documentation*
Check one:
PR Checklist*
cargo fmt
on default settings.