-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.improve-diagnosticsRelated to the quality of diagnostic messagesRelated to the quality of diagnostic messages
Description
The code below produces an error but the error message reported by the analyzer is unclear.
enum E<T> {
e0.id(1);
final int v;
const E.id(this.v);
}
main() {
print(E.id); // Analyzer: Generative enum constructors can only be used as targets of redirection. Try using an enum value, or factory constructor. • invalid_reference_to_generative_enum_constructor
}An error message reported by CFE is much clearer. It is "Error: Enum constructors can't be torn off.". Please update the analyzer's error message for enum constructor tear-off.
Metadata
Metadata
Assignees
Labels
area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.improve-diagnosticsRelated to the quality of diagnostic messagesRelated to the quality of diagnostic messages