diff --git a/src/Psalm/Checker/FunctionChecker.php b/src/Psalm/Checker/FunctionChecker.php index 851ecad50..583f13453 100644 --- a/src/Psalm/Checker/FunctionChecker.php +++ b/src/Psalm/Checker/FunctionChecker.php @@ -792,7 +792,6 @@ class FunctionChecker extends FunctionLikeChecker * @return array> * @psalm-suppress MixedInferredReturnType as the use of require buggers things up * @psalm-suppress MixedAssignment - * @psalm-suppress MoreSpecificReturnType */ protected static function getCallMap() { diff --git a/src/Psalm/Checker/Statements/Expression/AssertionFinder.php b/src/Psalm/Checker/Statements/Expression/AssertionFinder.php index 04d333cf5..30d85e0b5 100644 --- a/src/Psalm/Checker/Statements/Expression/AssertionFinder.php +++ b/src/Psalm/Checker/Statements/Expression/AssertionFinder.php @@ -26,7 +26,6 @@ class AssertionFinder * @param StatementsSource $source * * @return array - * @psalm-suppress MoreSpecificReturnType */ public static function getAssertions( PhpParser\Node\Expr $conditional, diff --git a/tests/ReturnTypeTest.php b/tests/ReturnTypeTest.php index 407724404..39a718a9a 100644 --- a/tests/ReturnTypeTest.php +++ b/tests/ReturnTypeTest.php @@ -608,6 +608,22 @@ class ReturnTypeTest extends TestCase }', 'error_message' => 'InvalidReturnStatement', ], + 'moreSpecificReturnType' => [ + ' 'MoreSpecificImplementedReturnType', + ], ]; } }