diff --git a/tests/ReturnTypeTest.php b/tests/ReturnTypeTest.php index 2198e88e8fe..a7e6a03bc84 100644 --- a/tests/ReturnTypeTest.php +++ b/tests/ReturnTypeTest.php @@ -1002,6 +1002,37 @@ function a($end): void{ } }' ], + 'returnTypeOfAbstractAndConcreteMethodInSiblingTraits' => [ + 'value; + } + } + + /** @template T */ + trait AnotherTrait { + /** @psalm-return T */ + abstract public function getValue(); + } + + class Test { + /** @use AggregateTrait */ + use AggregateTrait; + + /** @use AnotherTrait */ + use AnotherTrait; + + public function __construct() { + $this->value = 123; + } + }' + ] ]; }