-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
Compiler: move checking function-scope-only builtins to AstGen #18096
Compiler: move checking function-scope-only builtins to AstGen #18096
Conversation
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.
This check should be in AstGen.
should I move check of all the functions such as |
Yes please.
That would be nice; and easier to implement since you can just switch on the builtin kind at the top of |
It looks like |
test blocks are indeed functions and should allow the builtins. it being non-null in comptime blocks seems sus though |
It is null for comptime blocks and correctly not null for tests: comptime {
try 1; //error: 'try' outside function scope
} |
not sure if latest commit contains complete list of such functions but I'm think it is |
Head branch was pushed to by a user without write access
@Vexu forgot about |
Head branch was pushed to by a user without write access
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.
Before, there was only one branch on the builtin tag. Now it does it twice. The way it was before was better, where it had if statements inside each of the branches of the switch.
If you wish to consolidate this information and make it declarative, then add a field to src/BuiltinFn.zig, don't add another switch like this.
I can rewrite it in next pr |
Thanks |
No description provided.