Skip to content

checker,cgen: fix missing validation for selector unwrapping + fix default return none for unwrapping - #23183

Merged
spytheman merged 4 commits into
vlang:masterfrom
felipensp:fix_unwrapped_none_code
Dec 16, 2024
Merged

spytheman merged 4 commits into
vlang:masterfrom
felipensp:fix_unwrapped_none_code

Conversation

@felipensp

@felipensp felipensp commented Dec 16, 2024 •

Copy link
Copy Markdown
Member

Fix missing selector checker for:

fn callback(foo &Foo) bool {
	return foo.func? == callback
}

Return type was not required to be ?bool in this case.

Beside this it was generating wrong none return code:
image

Hulyยฎ: V_0.6-21620

@felipensp felipensp changed the title cgen: fix missing validation for selector unwrapping + fix default return none for unwrapping checker,cgen: fix missing validation for selector unwrapping + fix default return none for unwrapping Dec 16, 2024
@felipensp
felipensp marked this pull request as ready for review December 16, 2024 21:09

@spytheman spytheman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good find.
Excellent work.

@spytheman
spytheman merged commit a200c45 into vlang:master Dec 16, 2024
@felipensp
felipensp deleted the fix_unwrapped_none_code branch December 16, 2024 21:18
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