You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the latest specification does not allow declaring index and values.
About values: "It's a compile-time error if the enum declaration contains a static or instance member declaration with the name values, or if the superclass or any superinterface of the enum declaration has an interface member named values. A values static constant member will be provided for the class, this restriction ensures that there is no conflict with that declaration."
About index: "It's a compile-time error if a class, mixin or enum declaration has Enum as a superinterface, and it declares a non-abstract instance member named index. That member would override the index getter inherited from Enum, and we currently do not allow that."
FAILED: dart2analyzer-none release_x64 co19/LanguageFeatures/Enhanced-Enum/semantics_A10_t05
Expected: Pass
Actual: CompileTimeError
--- Command "dart2analyzer" (took 19.000946s):
DART_CONFIGURATION=ReleaseX64 sdk/bin/dartanalyzer -Dtest_runner.configuration=custom-configuration-1 --enable-experiment=enhanced-enums --ignore-unrecognized-flags --packages=/Users/scheglov/Source/Dart/sdk.git/sdk/.packages --format=json --no-hints /Users/scheglov/Source/Dart/sdk.git/sdk/tests/co19/src/LanguageFeatures/Enhanced-Enum/semantics_A10_t05.dart
unexpected analysis errors in semantics_A10_t05.dart:
- Line 27, column 11: COMPILE_TIME_ERROR.ILLEGAL_NON_ABSTRACT_ENUM_INDEX
A non-abstract instance member named 'index' can't be declared in a class that implements 'Enum'.
- Line 40, column 11: COMPILE_TIME_ERROR.ILLEGAL_NON_ABSTRACT_ENUM_INDEX
A non-abstract instance member named 'index' can't be declared in a class that implements 'Enum'.
unexpected analysis errors in ../../Utils/expect_common.dart:
- Line 253, column 11: TODO.TODO
TODO check that key sets are equivalent.
--- Re-run this test:
python3 tools/test.py -m release -c dart2analyzer co19/LanguageFeatures/Enhanced-Enum/semantics_A10_t05
The text was updated successfully, but these errors were encountered:
I think the latest specification does not allow declaring
index
andvalues
.About
values
: "It's a compile-time error if the enum declaration contains a static or instance member declaration with the name values, or if the superclass or any superinterface of the enum declaration has an interface member named values. A values static constant member will be provided for the class, this restriction ensures that there is no conflict with that declaration."About
index
: "It's a compile-time error if a class, mixin or enum declaration has Enum as a superinterface, and it declares a non-abstract instance member named index. That member would override the index getter inherited from Enum, and we currently do not allow that."The text was updated successfully, but these errors were encountered: