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

cgen: fix codegen for if comptime with -g #22888

Merged
merged 3 commits into from
Nov 18, 2024

Conversation

felipensp
Copy link
Member

@felipensp felipensp commented Nov 17, 2024

@felipensp felipensp marked this pull request as ready for review November 17, 2024 17:06
Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

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

Excellent work.

@spytheman
Copy link
Member

spytheman commented Nov 17, 2024

The test should be moved as a .vv/.out file pair under vlib/v/gen/c/testdata/ , that has this comment line at its top:
// vtest vflags: -g

It can print anything, for example println('done'), so that the .out file will not be empty.

Otherwise, -g is not passed by default, and the program compiles normally without it on master as well.

@spytheman spytheman merged commit 47c7858 into vlang:master Nov 18, 2024
72 checks passed
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.

cgen error when -g is used on a program containing an if expression, with comptime if inside its branches
2 participants