Skip to content

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
@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