Skip to content

Commit 7427d1a

Browse files
committed
Fix late static binding calls for first class callable
1 parent 31f6737 commit 7427d1a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/PHPStan/Analyser/nsrt/static-late-binding.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,15 @@ public function foo(): void
112112
assertType('bool', $v);
113113
$clUnioned->outStaticConst($v);
114114
assertType('bool', $v); // should be bool|int
115+
116+
assertType('StaticLateBinding\A', A::retStatic(...)());
117+
assertType('StaticLateBinding\B', B::retStatic(...)());
118+
assertType('static(StaticLateBinding\B)', self::retStatic()(...));
119+
assertType('static(StaticLateBinding\B)', static::retStatic(...)());
120+
assertType('static(StaticLateBinding\B)', parent::retStatic(...)());
121+
assertType('static(StaticLateBinding\B)', $this->retStatic(...)());
122+
assertType('bool', X::retStatic(...)());
123+
assertType('bool|StaticLateBinding\A|StaticLateBinding\X', $clUnioned::retStatic(...)()); // should be bool|StaticLateBinding\A
115124
}
116125
}
117126

0 commit comments

Comments
 (0)