Skip to content

Semicolon does not parse in match types #13331

Closed
@neko-kai

Description

@neko-kai

Compiler version

3.0.1

Minimized code

def Choice = (_: Any) match { case Int => Long; case Long => Int } // ok

type Choice[A] = A match { case Int => Long ; case Long => Int } // error

https://scastie.scala-lang.org/popPHRHGRTmfZ9n41Un3fQ

Output

'}' expected, but ';' found

Illegal start of toplevel definition

Expectation

Expected the semicolon to separate match type cases the same as for value matches. Couldn't find a previous discussion on this, so I assume this is not intended?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions