Skip to content

Cannot use "T is never" in conditional return #9634

@mathroc

Description

@mathroc

Bug report

I'm trying to tell PHPStan that a function returns something different if the generic type on the class or interface is never but PHPStan won't let me :)

Code snippet that reproduces the problem

https://phpstan.org/r/8a40999a-cd40-4a84-a547-ba5fcfe6fb0a

Expected output

Only the second issue about returning false instead of true in the example should be returned

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

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions