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 missing check for concrete type on match branch expr #23508

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

felipensp
Copy link
Member

Fix #23506

Copy link

Connected to Huly®: V_0.6-21937

@felipensp felipensp marked this pull request as ready for review January 18, 2025 12:02
@spytheman
Copy link
Member

(the CI failure is unrelated and already fixed on master)

@@ -0,0 +1,7 @@
vlib/v/checker/tests/match_generic_case_err.vv:16:4: error: return type mismatch, it should be `int`
Copy link
Member

Choose a reason for hiding this comment

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

That seems a bit unclear 🤔
Can the error also show the type that the compiler thinks v is too?
Something like this can be less puzzling:

vlib/v/checker/tests/match_generic_case_err.vv:16:4: error: return type mismatch, it should be `int`, but it is instead `string`

Copy link
Member

Choose a reason for hiding this comment

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

(not in the same PR, but in general)

Copy link
Member

Choose a reason for hiding this comment

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

especially for generic code, I think it will help a lot

Copy link
Member Author

Choose a reason for hiding this comment

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

I do agree.

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.

C compilation error while matching generic type
2 participants