From 4b0690edc4d561f507792a392a2d7d5852eeecc9 Mon Sep 17 00:00:00 2001 From: Nathanael Esayeas Date: Fri, 24 May 2024 10:46:09 -0500 Subject: [PATCH] Add test case Co-Authored-By: Vincent Langlet Signed-off-by: Nathanael Esayeas --- tests/PureAnnotationTest.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/PureAnnotationTest.php b/tests/PureAnnotationTest.php index 57c27e7b113..4242fec0237 100644 --- a/tests/PureAnnotationTest.php +++ b/tests/PureAnnotationTest.php @@ -538,6 +538,30 @@ class Date2{ Date2::tt(); ', ], + 'Issue #10974 - https://github.com/vimeo/psalm/issues/10974' => [ + 'code' => 'int = $int; + } + } + + class Factory + { + /** @psalm-pure */ + public function getFoo(): Foo + { + return new Foo(42); + } + } + ', + ], ]; }