-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consider type parameter defaults in TypeAppVarianceCheckT
Summary: When we compare type typeapps with the same root, we take a shortcut and only compare the type arguments according to the polarity of the type parameter. This shortcut did not properly account for type parameter defaults. This diff handles the default case by ensuring that all type arguments are constrained. Reviewed By: jbrown215 Differential Revision: D15675738 fbshipit-source-id: 35cee8b2789ecc48a89717b557fea3bd177f3fa4
- Loading branch information
1 parent
e943b69
commit dc2cfac
Showing
3 changed files
with
49 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
declare opaque type A; | ||
declare opaque type B: A; | ||
|
||
class C<+Out, -In: Out = Out> {} | ||
|
||
declare var x: C<B>; | ||
(x: C<A>); // error: A ~> B in default-expanded type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters