Skip to content

Don't force the same type in match arms that are only evaluated for side effects or allow ; in match arms #16858

Closed
@mahkoh

Description

@mahkoh
match x {
    A => f(),
    B => g(),
}

This does not work if f and g return different types. Since the return value is discarded, this does not matter. Alternatively:

match x {
    A => f();,
    B => g();,
}

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