mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
Make test better
This commit is contained in:
parent
c27d0d953b
commit
af52590fef
@ -3469,43 +3469,43 @@ class ClassTemplateExtendsTest extends TestCase
|
||||
* @template T1
|
||||
*/
|
||||
class Foo {
|
||||
/** @var T */
|
||||
/** @var T1 */
|
||||
public $t;
|
||||
|
||||
/** @param T $t */
|
||||
/** @param T1 $t */
|
||||
public function __construct($t) {
|
||||
$this->t = $t;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @template T2
|
||||
*/
|
||||
class Bar {
|
||||
/** @var T */
|
||||
/** @var T2 */
|
||||
public $t;
|
||||
|
||||
/** @param T $t */
|
||||
/** @param T2 $t */
|
||||
public function __construct($t) {
|
||||
$this->t = $t;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @template T1
|
||||
* @extends Bar<Foo<T1>>
|
||||
* @template T3
|
||||
* @extends Bar<Foo<T3>>
|
||||
*/
|
||||
class BarOfFoo extends Bar {
|
||||
/** @param T1 $t */
|
||||
/** @param T3 $t */
|
||||
public function __construct($t) {
|
||||
parent::__construct(new Foo($t));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @template T2
|
||||
* @param T2 $t
|
||||
* @return Bar<Foo<T2>>
|
||||
* @template T4
|
||||
* @param T4 $t
|
||||
* @return Bar<Foo<T4>>
|
||||
*/
|
||||
function baz($t) {
|
||||
return new BarOfFoo("hello");
|
||||
|
Loading…
Reference in New Issue
Block a user