diff --git a/tests/Template/ClassTemplateTest.php b/tests/Template/ClassTemplateTest.php index 4105b6dfb12..912b565f282 100644 --- a/tests/Template/ClassTemplateTest.php +++ b/tests/Template/ClassTemplateTest.php @@ -4051,6 +4051,64 @@ public function __construct( 'ignored_issues' => [], 'php_version' => '8.0', ], + 'template of simple type with additional comment without dot' => [ + 'code' => 't = $t; + } + + /** + * @psalm-return T + */ + public function t(): string { + return $this->t; + } + } + $t = (new Foo(\'\'))->t(); + ', + 'assertions' => [ + '$t===' => '\'\'', + ], + ], + 'template of simple type with additional comment with dot' => [ + 'code' => 't = $t; + } + + /** + * @psalm-return T + */ + public function t(): string { + return $this->t; + } + } + $t = (new Foo(\'\'))->t(); + ', + 'assertions' => [ + '$t===' => '\'\'', + ], + ], ]; }