Closed
Description
The folllowing co19 test fails https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Enhanced-Enum/semantics_A09_t02.dart
enum E1 {
// ^^
// [cfe] unspecified
e1,
//^^
// [analyzer] unspecified
e2,
e3;
final int e1 = 42;
// ^^
// [cfe] unspecified
}
enum E2<T> {
// ^^
// [cfe] unspecified
e1<int>(42), // Fails here. Unexpected error at line 38, column 3: Constant evaluation error:
e2<String>("42"),
//^^
// [analyzer] unspecified
e3<bool>(false);
const E2(T t);
final List<E2> e2 = const [];
// ^^
// [cfe] unspecified
}
enum E3 {
// ^^
// [cfe] unspecified
e1,
e2,
e3;
static final int e1 = 42;
// ^^
// [analyzer] unspecified
}
main() {
print(E1);
print(E2);
print(E3);
}
Why "Unexpected error at line 38, column 3: Constant evaluation error:" occurs. I don't see any errors on this line. To rerun the test use python3 tools/test.py -n cfe-strong-linux co19/LanguageFeatures/Enhanced-Enum/semantics_A09_t02
cc @eernstg
Tested on Dart SDK version: 2.17.0-edge.6bcc451e597867cb7c0b4f21d9143d0a43cbb401 (be) (Tue Feb 8 01:49:35 2022 +0000) on "linux_x64"
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
eernstg commentedon Feb 8, 2022
Right, I couldn't see a reason for that error on line 38. Also I saw some 'Constant expression depends on itself' errors that I couldn't explain.
chloestefantsova commentedon Feb 8, 2022
It seems to be an error triggered by the unhandled name conflict. I'm working on detecting and handling those conflicts, and it should fix this issue as well.