-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
165 additions
and
36 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
function foo(): void { | ||
$p1 = 0; | ||
|
||
while (rand(0, 1)) { | ||
if (rand(0, 1)) { | ||
if ($p1 === 0) { | ||
bar($p1); | ||
} else { | ||
$p1 = $p1 - 1; | ||
} | ||
} | ||
|
||
if (rand(0, 1)) { | ||
$p1 = $p1 - 1; | ||
} | ||
} | ||
|
||
bar($p1); | ||
} | ||
|
||
function bar(int $i): void {} |
9 changes: 9 additions & 0 deletions
9
tests/inference/DictVecKeyset/possiblyInvalidShapeKey/input.hack
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,9 @@ | ||
function foo(shape('a' => string) $arr): void { | ||
} | ||
|
||
function bar(shape('a' => string) $arr, int $i): void { | ||
if (rand(0, 1)) { | ||
$arr['a'] = $i; | ||
} | ||
foo($arr); | ||
} |
1 change: 1 addition & 0 deletions
1
tests/inference/DictVecKeyset/possiblyInvalidShapeKey/output.txt
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 @@ | ||
ERROR: PossiblyInvalidArgument - input.hack:8:9 - Argument 1 of foo expects shape('a' => string), possibly different type shape('a' => string|int) provided in :4:45 is a mismatch with string |
21 changes: 21 additions & 0 deletions
21
tests/inference/Generics/Class/enumMemberMatchesEnum/input.hack
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,21 @@ | ||
final class A<T> { | ||
public function __construct(public T $t) {} | ||
} | ||
|
||
function makeA<T>(T $t): A<T> { | ||
return new A($t); | ||
} | ||
|
||
enum B: int as int { | ||
A = 1; | ||
B = 2; | ||
C = 3; | ||
} | ||
|
||
function foo(): void { | ||
$a = makeA(B::B); | ||
bar($a); | ||
} | ||
|
||
function bar(A<B> $_a): void { | ||
} |
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 @@ | ||
newtype foo_t as other_t = other_t; |
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,10 @@ | ||
final class A<T> { | ||
public function __construct(public T $t) {} | ||
} | ||
|
||
function foo(A<foo_t> $a): void { | ||
bar($a); | ||
} | ||
|
||
function bar(A<string> $_a): void { | ||
} |
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 @@ | ||
newtype other_t as string = string; |