Skip to content

Empty enum bodies are accepted #5015

Closed
Closed
@Blaisorblade

Description

@Blaisorblade

After enum A extends AnyRef the REPL thinks the line is not over and requires braces. The REPL should instead do the same it does for classes:

scala> class A extends AnyRef
// defined class A

scala> enum A extends AnyRef
     | {}
// defined class A

(noticed while testing #5008).

EDIT: enum A extends AnyRef {} is forbidden by the grammar, see below.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions