Skip to content
Permalink
Browse files

Fix #2106 - add defining class to converted template

  • Loading branch information...
muglug committed Sep 7, 2019
1 parent 8be4339 commit e7a69f715d91ec2371ea60abc17a68eb0f57110f
Showing with 15 additions and 1 deletion.
  1. +2 −1 src/Psalm/Type/Union.php
  2. +13 −0 tests/Template/ClassTemplateTest.php
@@ -1167,7 +1167,8 @@ public function replaceTemplateTypesWithStandins(
? 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 @@ public function __construct() {
}
}'
],
'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);
}
}',
],
];
}

0 comments on commit e7a69f7

Please sign in to comment.
You can’t perform that action at this time.