mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
Fix #2106 - add defining class to converted template
This commit is contained in:
parent
8be43398f0
commit
e7a69f715d
@ -1167,7 +1167,8 @@ class Union
|
||||
? new Union([$input_atomic_type->as_type])
|
||||
: ($input_atomic_type->as === 'object'
|
||||
? Type::getObject()
|
||||
: Type::getMixed())
|
||||
: Type::getMixed()),
|
||||
$input_atomic_type->defining_class
|
||||
);
|
||||
} elseif ($input_atomic_type instanceof Type\Atomic\TClassString) {
|
||||
if ($input_atomic_type->as_type) {
|
||||
|
@ -1690,6 +1690,19 @@ class ClassTemplateTest extends TestCase
|
||||
}
|
||||
}'
|
||||
],
|
||||
'reflectTemplatedClass' => [
|
||||
'<?php
|
||||
/** @template T1 of object */
|
||||
class Foo {
|
||||
/**
|
||||
* @param class-string<T1> $a
|
||||
* @psalm-return ReflectionClass<T1>
|
||||
*/
|
||||
public function reflection(string $a) {
|
||||
return new ReflectionClass($a);
|
||||
}
|
||||
}',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user