mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
attempt to fix #6973
This commit is contained in:
parent
b42c2814a9
commit
dac8c98613
@ -980,9 +980,7 @@ class MethodComparator
|
||||
$implementer_called_class_name
|
||||
);
|
||||
|
||||
if (isset(
|
||||
$implementer_called_class_storage->template_extended_params[$implementer_classlike_storage->name]
|
||||
)) {
|
||||
if ($implementer_called_class_storage->template_extended_params) {
|
||||
self::transformTemplates(
|
||||
$implementer_called_class_storage->template_extended_params,
|
||||
$implementer_classlike_storage->name,
|
||||
|
@ -1032,7 +1032,35 @@ class ReturnTypeTest extends TestCase
|
||||
$this->value = 123;
|
||||
}
|
||||
}'
|
||||
]
|
||||
],
|
||||
'returnTypeOfAbstractMethodFromTemplatedTraitAndImplementationFromNonTemplatedTrait' => [
|
||||
'<?php
|
||||
trait ImplementerTrait {
|
||||
/** @var int */
|
||||
private $value;
|
||||
|
||||
public function getValue(): int {
|
||||
return $this->value;
|
||||
}
|
||||
}
|
||||
|
||||
/** @psalm-template T */
|
||||
trait GuideTrait {
|
||||
/** @psalm-return T */
|
||||
abstract public function getValue();
|
||||
}
|
||||
|
||||
class Test {
|
||||
use ImplementerTrait;
|
||||
|
||||
/** @template-use GuideTrait<int> */
|
||||
use GuideTrait;
|
||||
|
||||
public function __construct() {
|
||||
$this->value = 123;
|
||||
}
|
||||
}'
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user