1
0
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:
Paweł Tomulik 2021-11-22 23:32:05 +01:00
parent b42c2814a9
commit dac8c98613
No known key found for this signature in database
GPG Key ID: 383742B6D85FF3D5
2 changed files with 30 additions and 4 deletions

View File

@ -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,

View File

@ -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;
}
}'
],
];
}