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, checker: allow none as arg to ?&type #21231

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

felipensp
Copy link
Member

Fix #21213

@felipensp felipensp marked this pull request as ready for review April 9, 2024 00:11
if ptr := maybe_ptr {
return *ptr
} else {
return 0
Copy link
Member

Choose a reason for hiding this comment

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

Please return (and assert) a different value. 0 is a default value for many things, and thus the test with it, is a bit less sensitive than what it could be.

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 23532d4 into vlang:master Apr 9, 2024
56 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.

cannot use none as a ?&Type
2 participants