Skip to content
Permalink
Browse files

Fix #2445 - only generalise param when it’s generic

  • Loading branch information
muglug committed Dec 9, 2019
1 parent 40bdc21 commit b78acf796f967c6d32c280bad447805f493968b1
@@ -1227,7 +1227,7 @@ private static function fleshOutAtomicType(
$return_type->value = $static_class_type;
} else {
if ($return_type instanceof Type\Atomic\TGenericObject
&& $static_class_type instanceof Type\Atomic\TNamedObject
&& $static_class_type instanceof Type\Atomic\TGenericObject
) {
$return_type->value = $static_class_type->value;
} else {
@@ -2420,6 +2420,30 @@ public function provide() {
}
}'
],
'extendsWithMoreTemplateParams' => [
'<?php
/**
* @template T
*/
class Container {
/** @var T */
private $t;
/** @param T $t */
public function __construct($t) {
$this->t = $t;
}
/** @return static<T> */
public function getAnother() {
return clone $this;
}
}
class MyContainer extends Container {}
$a = (new MyContainer("hello"))->getAnother();',
],
];
}

0 comments on commit b78acf7

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