-
-
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
v: fix generic lambda type binding and resolution #22083
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work.
Will the same approach work for generic functions, calling other generic functions, with a LambdaExpr ?
Try adding such an example in the test case too, with |x,y| x + y
, where x and y are in one call 2 ints, and in another call, 2 strings .
Perhaps a 3rd case where one is an int and the other a string, for a known error case? |
Yeah, Just tested: fn ddd[T](call fn (arg1 T, arg2 T) string, arg1 T, arg2 T) string {
return call(arg1, arg2)
}
fn abc[T](arg1 T, arg2 T) string {
return ddd(|x,y| (x+y).str(), arg1, arg2)
}
fn main() {
abc('3', '3')
abc(3, 3)
abc(3.1, 3.1)
} It needs more work to make it possible... I'll check it. |
I've handled this case. Have you any other test case? @spytheman |
I could not think of any other @felipensp . Excellent work. |
Fix #19426