Skip to content

Commit fad2dc1

Browse files
committed
Add regression test for #6623
Closes phpstan/phpstan#6623
1 parent 70b43f2 commit fad2dc1

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace Bug6623;
4+
5+
use function PHPStan\Testing\assertType;
6+
7+
class World {
8+
protected function bar(): void {}
9+
}
10+
11+
class HelloWorld extends World
12+
{
13+
private ?int $foo = null;
14+
15+
public function useFoo(): void
16+
{
17+
if (is_null($this->foo)) {
18+
throw new \LogicException();
19+
}
20+
assertType('int', $this->foo);
21+
$this->bar();
22+
assertType('int', $this->foo);
23+
}
24+
}

0 commit comments

Comments
 (0)