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 some specific interface generic inference within generic struct and method #20932

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

GGRei
Copy link
Contributor

@GGRei GGRei commented Mar 1, 2024

Fix #19214

@spytheman
Copy link
Member

Does it work for #20762 too?

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 a87ba9e into vlang:master Mar 1, 2024
54 checks passed
@GGRei
Copy link
Contributor Author

GGRei commented Mar 1, 2024

Does it work for #20762 too?

From what I've seen, no, this does not resolve the issue 20762.

For this other problem, the compiler fails to make the connection and deduce that it is an interface:

HasBeforeRequest[X]

The compiler marks it as a placeholder, and that's what causes the problem.

When the "unwrap_generic" method is used, everything apparently goes correctly since for both methods (the generic and the one with a specified concrete type), it results in:

&main.HasBeforeRequest[main.Context]

But for one, the interface is recognized, and for the other, it is not.

Unfortunately, I have not had the time to investigate further at the moment.

raw-bin pushed a commit to raw-bin/v that referenced this pull request Mar 9, 2024
raw-bin pushed a commit to raw-bin/v that referenced this pull request Mar 9, 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.

Could not infer generic on interface
2 participants