Skip to content

[Enhanced enums] CFE error report wording issues #48298

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

Open
sgrekhov opened this issue Feb 3, 2022 · 0 comments
Open

[Enhanced enums] CFE error report wording issues #48298

sgrekhov opened this issue Feb 3, 2022 · 0 comments
Assignees
Labels
legacy-area-front-end Legacy: Use area-dart-model instead.

Comments

@sgrekhov
Copy link
Contributor

sgrekhov commented Feb 3, 2022

Please see the following co19 test https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Enhanced-Enum/semantics_A10_t03.dart

CFE prodices the following error on this test.

/===================================================================================================================================\
| cfe-strong-linux:co19/LanguageFeatures/Enhanced-Enum/semantics_A10_t03 is new and failed (MissingCompileTimeError, expected Pass) |
\===================================================================================================================================/

--- Command "fasta" (took 136ms):
(cd /b/s/w/ir/ ; DART_CONFIGURATION=ReleaseX64 ./out/ReleaseX64/dart ./pkg/front_end/tool/_fasta/compile.dart --verify --skip-platform-verification -o ./out/ReleaseX64/generated_compilations/cfe-strong-linux/tests_co19_src_LanguageFeatures_Enhanced-Enum_semantics_A10_t03/out.dill --platform ./out/ReleaseX64/vm_platform_strong.dill -Dtest_runner.configuration=cfe-strong-linux --enable-experiment=enhanced-enums --nnbd-strong --packages=./.packages ./tests/co19/src/LanguageFeatures/Enhanced-Enum/semantics_A10_t03.dart )

static error failures:
- Unexpected error at line 31, column 6: Applying the mixin 'M1' to '_Enum' introduces an erroneous override of 'index'.

- Unexpected error at line 31, column 6: Applying the mixin 'M1' to '_Enum' introduces an erroneous override of 'toString'.

- Unexpected error at line 31, column 6: The return type of the method 'E1.toString' is 'String', which does not match the return type, 'int', of the overridden method, '_Enum with M1.toString'.

- Unexpected error at line 49, column 6: Can't declare a member that conflicts with an inherited one.

- Unexpected error at line 49, column 6: Can't inherit members that conflict with each other.

--- Re-run this test:
python3 tools/test.py -n cfe-strong-linux co19/LanguageFeatures/Enhanced-Enum/semantics_A10_t03
  • The error message should probably not mention _Enum.
  • The override errors for index and toString are reported correctly, but on E1 where M1 is applied, and they could be reported in M1 (there is no way M1 could be successfully applied to any superclass).
  • The errors on line 49 are not informative.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy-area-front-end Legacy: Use area-dart-model instead.
Projects
None yet
Development

No branches or pull requests

2 participants