Skip to content

co19/LanguageFeatures/Enhanced-Enum/semantics_A10_t05 #1297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
scheglov opened this issue Feb 9, 2022 · 0 comments
Closed

co19/LanguageFeatures/Enhanced-Enum/semantics_A10_t05 #1297

scheglov opened this issue Feb 9, 2022 · 0 comments
Assignees

Comments

@scheglov
Copy link

scheglov commented Feb 9, 2022

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
@sgrekhov sgrekhov self-assigned this Feb 10, 2022
copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Feb 14, 2022
2022-02-11 [email protected] dart-lang/co19#1260. WeakReference.target test added
2022-02-11 [email protected] dart-lang/co19#1260. Test that use ffi moved to a separate directory
2022-02-11 [email protected] dart-lang/co19#1260. Optional parameters added to triggerGcWithDelay()
2022-02-10 [email protected] dart-lang/co19#1260: Added tests for Finalizer.attach method.
2022-02-10 [email protected] dart-lang/co19#1260. Unnecessary delays removed form WeakReference tests
2022-02-10 [email protected] dart-lang/co19#1292. Compile error in Enhanced enums example fixed
2022-02-10 [email protected] Fixes dart-lang/co19#1297. User-written 'index' is not allowed
2022-02-10 [email protected] Fixes dart-lang/co19#1293. Change expected error location in analyzer
2022-02-09 [email protected] dart-lang/co19#1260: Added tests for Finalizer.
2022-02-09 [email protected] dart-lang/co19#1258. Enhanced enums test fixed, issue numbers added
2022-02-09 [email protected] dart-lang/co19#1260: Added tests for Finalizer.
2022-02-08 [email protected] dart-lang/co19#1260: Added tests for Finalizer.
2022-02-08 [email protected] dart-lang/co19#1258. Add more tests on user-written 'index' and 'values'
2022-02-08 [email protected] dart-lang/co19#1289. More roll failures fixed
2022-02-08 [email protected] dart-lang/co19#1289. Roll failures fixed
2022-02-08 [email protected] Fixes dart-lang/co19#1290. Constant constructors can't have a body
2022-02-08 [email protected] dart-lang/co19#1260: Updated LanguageFeatures/FinalizationRegistry/Finalizer tests.
2022-02-07 [email protected] dart-lang/co19#1258. Update Enhanced Enums test. Now user-written 'values' and 'index' are not allowed
2022-02-07 [email protected] Fixes dart-lang/co19#1288. Remove 'index' declaration

Cq-Include-Trybots: dart/try:analyzer-nnbd-linux-release-try,dart2js-nnbd-linux-x64-chrome-try,ddc-nnbd-linux-release-chrome-try,front-end-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-release-simarm-try,vm-kernel-nnbd-linux-release-simarm64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-nnbd-win-release-x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-release-simarm64-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-nnbd-mac-release-simarm64-try,vm-kernel-precomp-nnbd-win-release-x64-try
Change-Id: I67d2028c58733088b5e46ea83092af1fa41c3c53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232600
Reviewed-by: William Hesse <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants