-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Description
Bug report
PHPDoc inline in new anonymous class creation causes Internal Error.
The use-case is adding a @psalm-immutable annotation to an anonymous class extending an immutable class as is described in the psalm documentation: https://psalm.dev/docs/annotating_code/supported_annotations/#psalm-immutable.
/** @psalm-immutable */
abstract class Foo {
}
new /** @psalm-immutable */ class extends Foo {
};
Using the --debug option prints:
PHP Fatal error: Uncaught PHPStan\ShouldNotHappenException: Internal error. in phar:///application/vendor/phpstan/phpstan/phpstan/src/Rules/Generics/ClassTemplateTypeRule.php:36
Code snippet that reproduces the problem
https://phpstan.org/r/6a77347f-d037-4793-a23a-a477f4b110c7
Expected output
No errors!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels