Skip to content

(new (class-string<T : U>)) !instanceOf U #2763

@hrach

Description

@hrach

Bug report

Seems instantiating string-class of T with bound doesn't properly resolve as instance of bound.

Parameter #1 $p of function take expects IFoo, T of IFoo given.

Code snippet that reproduces the problem

https://phpstan.org/r/49c9c801-9735-47b6-aa85-5ad0c3c98c9d

Expected output

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