mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 02:57:35 +00:00
85a12eac55
When testing the subtype relation between two generic function types, uninstantiated type variables can appear as an argument or return type of one function while a concrete type appears in corresponding position of the other function. A subtype relation can be established if the bound of the type variable is a subtype of the concrete type. For example given a type variable T with bound B and a concrete type C we can say: T <: C when T <: B <: C holds. T <: B is true by the definition of interface subtypes `T extends B`. This change adds a test for B <: C. Add a new class used only when it appears we may need to test these subtype relations. The class is used to plumb the bound information of type variables further into the subtype check algorithm where it is now tested. Add a top level variable to index the total number of type arguments seen during a subtype check through nested function types. Change-Id: If6aa13e7b758f7fedcb5dbd8e09d366082198e61 Fixes: https://github.com/dart-lang/sdk/issues/38816 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213527 Commit-Queue: Nicholas Shahan <nshahan@google.com> Reviewed-by: Mayank Patke <fishythefish@google.com> |
||
---|---|---|
.. | ||
bin | ||
lib | ||
api_readme.md | ||
BUILD.gn |