Skip to content

Compile error when a function branch always returns early #4565

@junetried

Description

@junetried

With this code, ponyc complains the first line of maybe_error isn't reachable. This modified version compiles as expected.

Match seems to give a different error. This code incorrectly believes the function body is None.

Reproduced in ponyc versions 0.58.0 and 0.58.7.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions