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

v: auto option wrapping when comparing != none #20275

Merged
merged 4 commits into from
Dec 27, 2023

Conversation

felipensp
Copy link
Member

Fix #18790

struct Test {
	a int
}

fn main() {
	a := ?int(1)
	if a != none {
		dump(a)
	}

	b := ?Test{
		a: 1
	}
	if b != none {
		dump(b)
	}
}

@felipensp felipensp changed the title v: autocast option when comparing != none v: auto option wrapping when comparing != none Dec 26, 2023
@felipensp felipensp marked this pull request as ready for review December 26, 2023 20:14
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 b944927 into vlang:master Dec 27, 2023
54 checks passed
@felipensp felipensp deleted the autocast_option branch December 27, 2023 19:22
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.

autocast Option type to real type inside if foo != none scope
2 participants