Skip to content

non-void function in untyped void function lead to sometimes returns something #2682

@adaamz

Description

@adaamz

Bug report

When we have void anonymous function that has non-void returning anonymous function, phpstan is unable to declare that outer function "returns" void.

Code snippet that reproduces the problem

https://phpstan.org/r/51e621e4-3353-43ee-ad98-73099ad897cd

Expected output

Anonymous function should have native return typehint "void".

Current output

Anonymous function sometimes return something but return statement at the end is missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions