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

checker: add support for Flags.bit ^ Flags.bit1 and ~Flags.bit #20929

Merged
merged 5 commits into from
Mar 1, 2024

Conversation

Delta456
Copy link
Member

Closes #20925

@Delta456 Delta456 marked this pull request as draft February 29, 2024 19:49
@Delta456 Delta456 marked this pull request as ready for review March 1, 2024 06:54
if right_sym.info is ast.Enum && !right_sym.info.is_flag {
c.error('operator `~` can only be used with `@[flag]` tagged enums', node.pos)
}
// Only check for int not enum as it is done above
Copy link
Member

Choose a reason for hiding this comment

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

That comment is superfluous, it just duplicates the code.

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 spytheman merged commit cc443e5 into vlang:master Mar 1, 2024
54 checks passed
raw-bin pushed a commit to raw-bin/v that referenced this pull request Mar 9, 2024
raw-bin pushed a commit to raw-bin/v that referenced this pull request Mar 9, 2024
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.

@[flag] enums should support all 4 bitwise operators, instead of only 2
3 participants