File tree Expand file tree Collapse file tree
tests/PHPStan/Analyser/nsrt Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,17 +46,25 @@ interface F
4646
4747}
4848
49+ class G {
50+ public static function u (): A &E {
51+ throw new \Exception ();
52+ }
53+ }
54+
55+ class H {
56+ public static function u (): B &F {
57+ throw new \Exception ();
58+ }
59+ }
60+
4961function () : void {
5062 assertType ('Closure(Bug14362\B): int ' , C::u ()(...));
5163 assertType ('Closure(Bug14362\B): int ' , D::u ()(...));
5264
5365 // Intersection with only yes-callable types (both have __invoke)
54- /** @var A&E $yesCallable */
55- $ yesCallable = C::u ();
56- assertType ('(Closure(Bug14362\B): int)|(Closure(string): bool) ' , $ yesCallable (...));
66+ assertType ('(Closure(Bug14362\B): int)|(Closure(string): bool) ' , G::u ()(...));
5767
5868 // Intersection with only maybe-callable types (neither has __invoke)
59- /** @var B&F $maybeCallable */
60- $ maybeCallable = C::u ();
61- assertType ('Closure ' , $ maybeCallable (...));
69+ assertType ('Closure ' , H::u ()(...));
6270};
You can’t perform that action at this time.
0 commit comments