Skip to content

Commit fb397cf

Browse files
committed
Test more persist/restore storage
1 parent 9b29716 commit fb397cf

File tree

1 file changed

+29
-0
lines changed
  • tests/PHPStan/Analyser/Generator/data

1 file changed

+29
-0
lines changed

tests/PHPStan/Analyser/Generator/data/gnsr.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff 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

140158
class 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+
};

0 commit comments

Comments
 (0)