Skip to content

try/catch seems to wipe out typeinfo from inline @var tags #2927

@dktapps

Description

@dktapps

Code snippet that reproduces the problem

Broken: https://phpstan.org/r/3b193843-1ecb-4653-b1e0-fee1803e50ee
Working: https://phpstan.org/r/bc2bc687-5de6-4a50-9f2f-9913994c2b37

The only difference between these samples is the placement of the line /** @var \ReflectionClass<MyEvent> $paramClass */.

Placing any other code in place of the try/catch seems to work as expected (ex: https://phpstan.org/r/6cd10b0f-e7da-4784-b3de-0806369a8440)

Expected output

Both samples should report no errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions