File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
tests/PHPStan/Analyser/Generator/data Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,24 @@ public static function returnPhpDocSelf()
135135
136136 }
137137
138+ /**
139+ * @template T
140+ * @param T $a
141+ * @return T
142+ */
143+ public static function genericStatic ($ a )
144+ {
145+
146+ }
147+
148+ public function doFoo2 (): void
149+ {
150+ assertType ('1 ' , self ::genericStatic (1 ));
151+
152+ $ s = 'GeneratorNodeScopeResolverTest \\FooWithStaticMethods ' ;
153+ assertType ('1 ' , $ s ::genericStatic (1 ));
154+ }
155+
138156}
139157
140158class ClosureFromCallableExtension
@@ -171,3 +189,14 @@ function (): void {
171189 $ foo = new FooGeneric (5 );
172190 assertType ('GeneratorNodeScopeResolverTest \\FooGeneric<int> ' , $ foo );
173191};
192+
193+ function (): void {
194+ $ c = new /** @template T of int */ class (1 , 2 , 3 ) {
195+ /**
196+ * @param T $i
197+ */
198+ public function __construct (private int $ i , private int $ j , private int $ k ) {
199+
200+ }
201+ };
202+ };
You can’t perform that action at this time.
0 commit comments