Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Missing result cache invalidation after modifying the @var annotation associated to a promoted property #14520

@claudepache

Description

@claudepache

Bug report

Consider a class with promoted property in constructor, whose type is specified in a @var annotation:

class c {
    function __construct(
        /** @var list<string> */
        public array $x
    ) { }
}

When I modify the @var annotation, the result cache incorrectly retains the old definition.

Code snippet that reproduces the problem

https://github.com/claudepache/phpstan-bug-cache1

Expected output

On step 5, the error should not persist.

Did PHPStan help you today? Did it make you happy in any way?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions