-
Notifications
You must be signed in to change notification settings - Fork 385
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
fix: builtin const func arg eval #3246
Conversation
Merge RequirementsThe following requirements must be fulfilled before a pull request can be merged. These requirements are defined in this configuration file. Automated Checks🔴 Maintainers must be able to edit this pull request Details
Manual ChecksNo manual checks match this pull request. |
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
I'm closing this as this will be fixed with #2828 |
There are special cases where functions are allowed to be called in a const context.
These functions are
Currently we only care about
len
andcap
but i added all of them as per spec.Calling functions in a const context means that the arguments in the call must be constant expressions as well.
This PR implements that.
Go also allows these to be assigned to variables (not only consts), which is handled as well.
Figuring out if its a relevant builtin function by comparing strings is okay because
Builtin functions are not alias-able
Closes #3201