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

checker: fix selector with prefixed & structinit #22689

Merged
merged 2 commits into from
Oct 30, 2024

Conversation

felipensp
Copy link
Member

@felipensp felipensp commented Oct 28, 2024

@medvednikov
Copy link
Member

I think it should result in checker error.

The V compiler promotes writing correct code.

@phcreery
Copy link
Contributor

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

@StunxFS
Copy link
Contributor

StunxFS commented Oct 29, 2024

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

Nice :)

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

defect &Object{}.a
5 participants