@@ -67,7 +67,7 @@ public function foo(): void
67
67
assertType ('int ' , parent ::retStaticConst ());
68
68
assertType ('2 ' , $ this ->retStaticConst ());
69
69
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
71
71
72
72
assertType ('int ' , A::retStaticConst (...)());
73
73
assertType ('2 ' , B::retStaticConst (...)());
@@ -76,7 +76,7 @@ public function foo(): void
76
76
assertType ('int ' , parent ::retStaticConst (...)());
77
77
assertType ('2 ' , $ this ->retStaticConst (...)());
78
78
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
80
80
81
81
assertType ('StaticLateBinding\A ' , A::retStatic ());
82
82
assertType ('StaticLateBinding\B ' , B::retStatic ());
@@ -85,7 +85,16 @@ public function foo(): void
85
85
assertType ('static(StaticLateBinding\B) ' , parent ::retStatic ());
86
86
assertType ('static(StaticLateBinding\B) ' , $ this ->retStatic ());
87
87
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
89
98
90
99
assertType ('static(StaticLateBinding\B) ' , A::retNonStatic ());
91
100
assertType ('static(StaticLateBinding\B) ' , B::retNonStatic ());
@@ -94,7 +103,7 @@ public function foo(): void
94
103
assertType ('static(StaticLateBinding\B) ' , parent ::retNonStatic ());
95
104
assertType ('static(StaticLateBinding\B) ' , $ this ->retNonStatic ());
96
105
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
98
107
99
108
A::outStaticConst ($ v );
100
109
assertType ('int ' , $ v );
0 commit comments