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

all: add support for alias bool assign operators #21684

Merged
merged 3 commits into from
Jun 16, 2024

Conversation

Delta456
Copy link
Member

@Delta456 Delta456 commented Jun 15, 2024

Implements &&= and ||= for alias with bool parent type

type Bool = bool

fn test_alias_bool_assign_operator() {
	mut flag := Bool(true)
	flag = flag || false
	assert flag == true

	flag ||= false
	assert flag == true

	flag &&= false
	assert flag == false
}

@Delta456 Delta456 marked this pull request as ready for review June 15, 2024 19:34
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 bebe943 into vlang:master Jun 16, 2024
76 checks passed
@Delta456 Delta456 deleted the alias_bool_assign_op branch June 16, 2024 09:30
raw-bin pushed a commit to raw-bin/v that referenced this pull request Jul 2, 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.

2 participants