From 29234dc04a5e76a855216597b974fadc5ca0cdfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Tomulik?= Date: Thu, 18 Nov 2021 23:13:08 +0100 Subject: [PATCH] fix issue #6937 --- tests/ReturnTypeTest.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) 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; + } + }' + ] ]; }