-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reverse top-level Flows in supertype
Summary: Although we accumulate provenance on the subtype during subtyping, we actually record typing time provenance on both types so the supertype may be a `Flow`. In this case we actually want the inner most element of the flow rather than the outer most (which is what we want for the subtype) This diff adds a function to reverse top-level flows and applies it to the supertype when rendering a subtyping error. Reviewed By: madgen Differential Revision: D63900892 fbshipit-source-id: 2c2034476c2ae0b5e68c01622f18bb9de8ecf090
- Loading branch information
1 parent
6cdb6c9
commit a57dfd6
Showing
8 changed files
with
44 additions
and
69 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
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
36 changes: 0 additions & 36 deletions
36
hphp/hack/test/extended_reasons/bad_inout_lvalue9.php.diff.exp
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 |
---|---|---|
@@ -1,36 +0,0 @@ | ||
--- control | ||
|
||
+++ test | ||
|
||
@@ -20,20 +20,20 @@ | ||
|
||
7 | } | ||
|
||
error: Typing[4110] Invalid argument to an inout parameter [1] | ||
--> Expected (int, int) [1] | ||
--> But got vec<int> [2] | ||
+-> Expected (int, int) because the type of this inout parameter is implicitly a like-type [2] | ||
+-> But got vec<int> [3] | ||
|
||
hphp/hack/test/extended_reasons/bad_inout_lvalue9.php:6:11 | ||
- 1 | <?hh | ||
- 2 | | ||
-[2] 3 | function f(inout varray<int> $a): void {} | ||
- 4 | | ||
- 5 | function test(int $x, int $y): void { | ||
-[1] 6 | f(inout tuple($x, $y)); | ||
- 7 | } | ||
+ 1 | <?hh | ||
+ 2 | | ||
+[2,3] 3 | function f(inout varray<int> $a): void {} | ||
+ 4 | | ||
+ 5 | function test(int $x, int $y): void { | ||
+[1] 6 | f(inout tuple($x, $y)); | ||
+ 7 | } | ||
|
||
error: Typing[4110] Invalid argument to an inout parameter [1] | ||
--> Expected (int, int) [1] | ||
+-> Expected (int, int) because the type of this inout parameter is implicitly a like-type [2] | ||
-> But got dynamic because the type of this inout parameter is implicitly a like-type [2] | ||
|
||
hphp/hack/test/extended_reasons/bad_inout_lvalue9.php:6:11 | ||
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
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