Skip to content

Commit 7cb81d7

Browse files
Add assertion
1 parent 7f70b4d commit 7cb81d7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tests/PHPStan/Rules/Arrays/data/bug-11679.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public function sayHello(int $index): bool
3232
if (!isset($this->arr[$index]['foo'])) {
3333
$this->arr[$index]['foo'] = true;
3434
assertType('non-empty-array<int, array{foo?: bool}>', $this->arr);
35+
assertType('array{foo: true}>', $this->arr[$index]);
3536
}
3637
assertType('array<int, array{foo?: bool}>', $this->arr);
3738
return $this->arr[$index]['foo']; // PHPStan does not realize 'foo' is set

0 commit comments

Comments
 (0)