Skip to content

consider making "Enumerations must contain at least one case" a warning #16375

Open
@unkarjedy

Description

@unkarjedy

In IntelliJ Scala Plugin there is an action which creates a new Class/Object/File/Enum:

When you create class/object/file it creates a tiny template which is compilable.
However in Scala 3 enum can't have zero cases.
So the template for Scala 3 enum produces code with error "Enumerations must contain at least one case"

It's not an issue with Java enum because Java supports enum with zero items.

I wonder is there a reason to make it an error?
I could write a sealed class MyEnum without any inheritors and the code would perfectly compile.
Maybe it makes sense to remove the error?
Or at least make it a warning?

(also see SCL-20747)

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