Skip to content

checker: fix selector with prefixed & structinit - #22689

Merged
medvednikov merged 2 commits into
vlang:masterfrom
felipensp:fix_amp_selector_struct_init
Oct 30, 2024
Merged

medvednikov merged 2 commits into
vlang:masterfrom
felipensp:fix_amp_selector_struct_init

Conversation

@felipensp

@felipensp felipensp commented Oct 28, 2024 •

Copy link
Copy Markdown
Member

Comment thread vlib/v/tests/selector_struct_init_amp_test.v
@medvednikov

Copy link
Copy Markdown
Member

I think it should result in checker error.

The V compiler promotes writing correct code.

@phcreery

Copy link
Copy Markdown
Contributor

Would enforcing (&Object{}).a (int) vs &(Object{}.a) (&int) make it less confusing?

@StunxFS

StunxFS commented Oct 29, 2024

Copy link
Copy Markdown
Contributor

Would enforcing (&Object{}).a (int) vs &(Object{}.a) (&int) make it less confusing?

@phcreery It makes no sense to instantiate a struct just to access a field.

@Delta456
Delta456 marked this pull request as ready for review October 29, 2024 14:20
@felipensp

Copy link
Copy Markdown
Member Author

image
Done. ๐Ÿ‘๐Ÿป

@felipensp felipensp changed the title cgen: fix selector with prefixed & structinit checker: fix selector with prefixed & structinit Oct 30, 2024
@medvednikov

Copy link
Copy Markdown
Member

Nice :)

@medvednikov
medvednikov merged commit 3af7209 into vlang:master Oct 30, 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.

defect &Object{}.a

5 participants