@@ -67,7 +67,7 @@ public function foo(): void
6767 assertType ('int ' , parent ::retStaticConst ());
6868 assertType ('2 ' , $ this ->retStaticConst ());
6969 assertType ('bool ' , X::retStaticConst ());
70- assertType ('*ERROR* ' , $ clUnioned ->retStaticConst ()); // should be bool|int
70+ assertType ('*ERROR* ' , $ clUnioned ->retStaticConst ()); // should be bool|int https://github.com/phpstan/phpstan/issues/11687
7171
7272 assertType ('int ' , A::retStaticConst (...)());
7373 assertType ('2 ' , B::retStaticConst (...)());
@@ -76,7 +76,7 @@ public function foo(): void
7676 assertType ('int ' , parent ::retStaticConst (...)());
7777 assertType ('2 ' , $ this ->retStaticConst (...)());
7878 assertType ('bool ' , X::retStaticConst (...)());
79- assertType ('mixed ' , $ clUnioned ->retStaticConst (...)()); // should be bool|int
79+ assertType ('mixed ' , $ clUnioned ->retStaticConst (...)()); // should be bool|int https://github.com/phpstan/phpstan/issues/11687
8080
8181 assertType ('StaticLateBinding\A ' , A::retStatic ());
8282 assertType ('StaticLateBinding\B ' , B::retStatic ());
@@ -85,7 +85,16 @@ public function foo(): void
8585 assertType ('static(StaticLateBinding\B) ' , parent ::retStatic ());
8686 assertType ('static(StaticLateBinding\B) ' , $ this ->retStatic ());
8787 assertType ('bool ' , X::retStatic ());
88- assertType ('bool|StaticLateBinding\A|StaticLateBinding\X ' , $ clUnioned ::retStatic ()); // should be bool|StaticLateBinding\A
88+ assertType ('bool|StaticLateBinding\A|StaticLateBinding\X ' , $ clUnioned ::retStatic ()); // should be bool|StaticLateBinding\A https://github.com/phpstan/phpstan/issues/11687
89+
90+ assertType ('StaticLateBinding\A ' , A::retStatic (...)());
91+ assertType ('StaticLateBinding\B ' , B::retStatic (...)());
92+ assertType ('static(StaticLateBinding\B) ' , self ::retStatic (...)());
93+ assertType ('static(StaticLateBinding\B) ' , static ::retStatic (...)());
94+ assertType ('static(StaticLateBinding\B) ' , parent ::retStatic (...)());
95+ assertType ('static(StaticLateBinding\B) ' , $ this ->retStatic (...)());
96+ assertType ('bool ' , X::retStatic (...)());
97+ assertType ('mixed ' , $ clUnioned ::retStatic (...)()); // should be bool|StaticLateBinding\A https://github.com/phpstan/phpstan/issues/11687
8998
9099 assertType ('static(StaticLateBinding\B) ' , A::retNonStatic ());
91100 assertType ('static(StaticLateBinding\B) ' , B::retNonStatic ());
@@ -94,7 +103,7 @@ public function foo(): void
94103 assertType ('static(StaticLateBinding\B) ' , parent ::retNonStatic ());
95104 assertType ('static(StaticLateBinding\B) ' , $ this ->retNonStatic ());
96105 assertType ('bool ' , X::retNonStatic ());
97- assertType ('*ERROR* ' , $ clUnioned ->retNonStatic ()); // should be bool|static(StaticLateBinding\B)
106+ assertType ('*ERROR* ' , $ clUnioned ->retNonStatic ()); // should be bool|static(StaticLateBinding\B) https://github.com/phpstan/phpstan/issues/11687
98107
99108 A::outStaticConst ($ v );
100109 assertType ('int ' , $ v );
0 commit comments