Skip to content

[Enhanced enums] Compile-time errors on language/enum/enhanced_enums_basic_test #48421

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
alexmarkov opened this issue Feb 17, 2022 · 1 comment
Labels
area-test Cross-cutting test issues (use area- labels for specific failures; not used for package:test).

Comments

@alexmarkov
Copy link
Contributor

Part of #48088.

Currently there are following compile-time errors on this test:

tests/language/enum/enhanced_enums_basic_test.dart:283:3: Error: Generative enum constructors must be marked as 'const'.
  EnumNoUnnamedConstructor.named(this.x);
  ^
tests/language/enum/enhanced_enums_basic_test.dart:293:3: Error: Generative enum constructors must be marked as 'const'.
  EnumFactoryUnnamedConstructor.named(this.x);
  ^
tests/language/enum/enhanced_enums_basic_test.dart:303:3: Error: Generative enum constructors must be marked as 'const'.
  Canonical(this.value);
  ^
tests/language/enum/enhanced_enums_basic_test.dart:317:21: Error: Enums can't contain declarations of members with the name 'values'.
  static String get values => "StaticDeclaration";
                    ^^^^^^
tests/language/enum/enhanced_enums_basic_test.dart:322:14: Error: Enums can't contain declarations of members with the name 'values'.
  String get values => "Declaration";
             ^^^^^^
tests/language/enum/enhanced_enums_basic_test.dart:325:6: Error: Can't declare a member that conflicts with an inherited one.
enum InheritsValues with ValuesMixin {
     ^^^^^^
tests/language/enum/enhanced_enums_basic_test.dart:369:14: Context: This is the inherited member.
  String get values => "Mixin";
             ^^^^^^
tests/language/enum/enhanced_enums_basic_test.dart:329:6: Error: Can't declare a member that conflicts with an inherited one.
enum ImplementsValues implements ValuesInterface {
     ^^^^^^
tests/language/enum/enhanced_enums_basic_test.dart:365:14: Context: This is the inherited member.
  String get values;
             ^^^^^^
tests/language/enum/enhanced_enums_basic_test.dart:309:11: Error: The return type of the method 'StringIndexEnum.index' is 'num', which does not match the return type, 'int', of the overridden method, '_Enum.index'.
Change to a subtype of 'int'.
  num get index => 3.5;

Repro:

tools/test.py -n dartk-strong-linux-release-x64 language/enum/enhanced_enums_basic_test

It looks like this test needs updating.

/cc @lrhn @eernstg

@alexmarkov alexmarkov added the area-test Cross-cutting test issues (use area- labels for specific failures; not used for package:test). label Feb 17, 2022
@eernstg
Copy link
Member

eernstg commented Feb 17, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-test Cross-cutting test issues (use area- labels for specific failures; not used for package:test).
Projects
None yet
Development

No branches or pull requests

2 participants