Skip to content

Commit 45e5b4a

Browse files
committed
Added regression test
1 parent beab3d7 commit 45e5b4a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php // lint >= 8.0
2+
3+
declare(strict_types = 1);
4+
5+
namespace Bug5207b;
6+
7+
use function PHPStan\Testing\assertType;
8+
9+
abstract class HelloWorld {
10+
abstract public function getChild(): ?HelloWorld;
11+
12+
public function sayHello(): void {
13+
$foo = null !== $this->getChild()->getChild();
14+
if ($foo) {
15+
assertType('Bug5207\HelloWorld', $this->getChild());
16+
assertType('Bug5207\HelloWorld', $this->getChild()->getChild());
17+
assertType('Bug5207b\HelloWorld|null', $this->getChild()->getChild()->getChild());
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)