Skip to content
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

Sema: forbid @breakpoint from being called at comptime #18071

Merged
merged 5 commits into from
Dec 11, 2023

Conversation

wrongnull
Copy link
Contributor

@wrongnull wrongnull commented Nov 22, 2023

No description provided.

@mlugg
Copy link
Member

mlugg commented Nov 22, 2023

@setAlignStack is probably fine at comptime, i.e. does not need to be disallowed. In addition, @work* already emitted perfectly valid compile errors if evaluated at comptime - please check these things before submitting patches.

Furthermore, your new test case cannot work, since @work* builtins are only available on the amdgcn architecture, so a different compile error is reached. This shows you didn't actually attempt to run your test case. Please do not waste CI resources on untested patches. EDIT: I just noticed you put the comptime check logic above the architecture check logic - apologies. The previous paragraph still applies.

Copy link
Member

@mlugg mlugg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(See previous comment)

@wrongnull
Copy link
Contributor Author

(See previous comment)

done

@wrongnull wrongnull changed the title Sema: forbid certain builtin funcions from being called in comptime Sema: forbid @breakpoint from being called at comptime Nov 22, 2023
@Vexu Vexu merged commit f88b523 into ziglang:master Dec 11, 2023
10 checks passed
@wrongnull wrongnull deleted the runtime-only-builtins branch December 11, 2023 18:24
@andrewrk
Copy link
Member

Reverted in 3d23ba9. @Vexu please do not merge any more @wrongnull pull requests without my explicit approval.

@wrongnull
Copy link
Contributor Author

Reverted in 3d23ba9. @Vexu please do not merge any more @wrongnull pull requests without my explicit approval.

@andrewrk Why this change doesn't seem right to you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants