Skip to content

Commit 97934fe

Browse files
staabmondrejmirtes
authored andcommitted
test
1 parent 6cfc99b commit 97934fe

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/PHPStan/Analyser/nsrt/narrow-tagged-union.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,19 @@ public function sayHello(array $arr): void
6464
public function nestedArrays(array $arr): void
6565
{
6666
// don't narrow when $arr contains recursive arrays
67-
6867
if (count($arr, COUNT_RECURSIVE) === 3) {
6968
assertType("array{array<int>, numeric-string}|array{string, '', non-empty-string}", $arr);
7069
} else {
7170
assertType("array{array<int>, numeric-string}|array{string, '', non-empty-string}", $arr);
7271
}
7372
assertType("array{array<int>, numeric-string}|array{string, '', non-empty-string}", $arr);
7473

74+
if (count($arr, COUNT_NORMAL) === 3) {
75+
assertType("array{string, '', non-empty-string}", $arr);
76+
} else {
77+
assertType("array{array<int>, numeric-string}", $arr);
78+
}
79+
assertType("array{array<int>, numeric-string}|array{string, '', non-empty-string}", $arr);
7580
}
7681
}
7782

0 commit comments

Comments
 (0)