Skip to content

Bare return statement in match arm does not parse #240

Description

@mkatychev

Seems that a return statement in a match arm (which nushell proper is fine with), is treated as invalid grammar

match ($val | describe) {
   "path" | "string" =>  {}
   _ => return
}
[2025-12-13T20:39:11Z ERROR topiary::error]   × Parsing error between line 0, column 25 and line 3, column 0
       ╭─[standard input:1:26]
     1 │ ╭─▶ match ($val | describe) {
     2 │ │      "path" | "string" =>  {}
     3 │ │      _ => return
     4 │ ├─▶ }
       · ╰──── (ERROR) node
       ╰────
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions