Skip to content

Generic return type gets corrupted by throw statement Pt. 2 #4442

@vojtech-dobes

Description

@vojtech-dobes

Bug report

By repeating issue title of #4422 I mean no disrespect, on contrary I appreciate all your work very much. I have basically followup problem where throwing in callback overrides explicitly stated return type of the callback.

Code snippet that reproduces the problem

https://phpstan.org/r/08fc7d84-0e65-4ea1-a5c7-f7e0762c4d4e

Expected output

Again I believe there should be no error: the presence of LogicException shouldn't in my opinion make this problematic code. Hopefully this requires some more extra handling of NeverType?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions