Skip to content

Multi-line expression after => does not get braces #4004

@RalfJung

Description

@RalfJung

In some cases, a multi-line expression in a match arm does not get braces, violating the spec.

This leads to code like this:

pat => fun(
    a,
    b,
    c,
    d,
)

We also don't generate code like this:

if foo { fun(
    a,
    b,
    c,
    d,
)}

so it seems odd to do that for match arms.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-matchesArea: match arms, patterns, blocks, etcI-poor-formattingIssue: poor formatting

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions