-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Strange type comparison for functions #33261
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
Comments
I'm just about to write an update to the super-bounded-types.md feature specification which introduces the notion of variance for each formal type parameter of a parameterized This is relevant because these variances will guide the definition of what it takes to be a correct super-bounded type when it involves a parameterized In particular, Similarly, The above-mentioned feature specification update is upcoming, so we still need to think about the details, but the overall idea should be as described. |
New development: super-bounded-types.md will not be updated, the above-mentioned changes are part of this CL, where the language specification is being extended to cover super-bounded types and variance. |
Closing: Given that this has been placed as an area-language issue, said commit bfa8be8 completes the effort. I've created a new meta-issue in order to get it implemented: #33444. With that in place, |
The following code sample compares type of some
Function
object with one defined withtypedef
:Sample output looks strange for me:
This shows that
void func(x) {print(x+2);}
is treated asF<String>
- this is strange asF
should have type argument which extendsint
(andString
does NOT extends it),At the same time, I see that void
func(x) {print(x+2);}
is notF1<String>
, and it looks expected.Also it;s not clear why
func is F
returnstrue
, butfunc1 is F1
returns `false - should not results be the same here?The text was updated successfully, but these errors were encountered: