Skip to content

Improve analyzer error message for an empty enum #60053

@sgrekhov

Description

@sgrekhov
enum E { // Analyzer error. The enum must have at least one constant. Try declaring a constant.
  ;
  static const c = 0;
}

I'd say that this enum has one constant. CFE error message in this case is better. It is "An enum declaration can't be empty.".

Dart SDK version: 3.8.0-66.0.dev (dev) (Sun Feb 2 20:05:47 2025 -0800) on "windows_x64"

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions