-
-
Notifications
You must be signed in to change notification settings - Fork 946
Description
Bug report
When using object shapes in a psalm-vendored annotation, phpstan will try to read the annotation and error if it doesn't understand the type.
Code snippet that reproduces the problem
See https://phpstan.org/r/12180a1f-7f95-4e23-a6b8-ae6c59e706b6 for an example. In the example, I'm declaring a type using @psalm-type that uses an object shape. Using this type in a @psalm-return annotation results in an error being reported. To compare, describing the return type directly in @psalm-return does not cause an error.
Expected output
I expect phpstan to not report errors when it can't understand a psalm-vendored annotation. I was surprised to find that phpstan reads psalm-vendored annotation, and while I understand there are benefits to doing so, it should make an effort to not trip over them when it can't understand them.