-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Missing generic method call generation at anonymous generic fn #18294
Comments
A short reproducible test case: pub struct Module {
}
pub struct Service {
callback fn ()
}
pub fn (mut self Module) do_anything[T]() {
}
pub fn (mut self Module) register[T]() {
_ := Service{
callback: fn [mut self] [T]() {
self.do_anything[T]()
}
}
}
struct Something {
}
struct SomethingDifferent {
}
fn main(){
mut mod := Module{}
mod.register[Something]()
mod.register[SomethingDifferent]()
} |
Hello, I was trying to update my things to the latest version of V, and the error is not fixed yet. If you try my original code, it fails (I runed a format on that code to get it compatible)
My current V version is: |
I just confirmed it. It is related to a regression caused by another unrelated fix. |
@Dracks this time the entire example from the issue was added as a regression test, not just a part of it. I hope you do not mind it, since that will prevent future regressions better. |
@spytheman On the contrary! that way won't be repeated. |
Describe the bug
Code: https://vosca.dev/p/b33945f186
When you try to run this code, raises a C code, if you transform it to C code, you can see that the function is generated for the struct Something but not for SomethingDifferent
Expected Behavior
The code runs well
Current Behavior
Output:
Reproduction Steps
I tried to do a small code from 0, and I was not able to reproducte, thats why I generate all this sample from my code (I already did some cleanup)
Possible Solution
No response
Additional Information/Context
No response
V version
V 0.3.4 fc4c431.45f16a2
Environment details (OS name and version, etc.)
The text was updated successfully, but these errors were encountered: