Skip to content

[Enhanced enums] CFE reports wrong setter/getter signature error #48297

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
sgrekhov opened this issue Feb 3, 2022 · 1 comment
Closed

[Enhanced enums] CFE reports wrong setter/getter signature error #48297

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

Comments

@sgrekhov
Copy link
Contributor

sgrekhov commented Feb 3, 2022

The following co19 test fails on CFE https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Enhanced-Enum/semantics_A09_t10.dart

import "../../Utils/expect.dart";

enum E1 {
  e1,
  e2,
  e3;

  static void set e1(E1 val) {
    Expect.equals(E1.e2, val);
  }
}

enum E2<T> {
  e1<int>(42),
  e2<String>("42"),
  e3<bool>(false);

  const E2(T t);
  static void set e1(E2<int> val) {
    Expect.equals(E2.e1, val);
  }
  static void set e2(E2<String> val) {
    Expect.equals(E2.e2, val);
  }
  static void set e3(E2<bool> val) {
    Expect.equals(E2.e3, val);
  }
}

main() {
  E1.e1 = E1.e2;
  E2.e1 = E2.e1;
  E2.e2 = E2.e2;
  E2.e3 = E2.e3;
}

The type of E2.e1 is considered to be E2<dynamic>, but it should be E2<int>, so there should not be a setter/getter
signature error

Tested on Dart SDK version: 2.17.0-edge.5e8e68c2c86983f8f4bc856e3ad5092db4d65f6c (be) (Thu Feb 3 01:08:34 2022 +0000) on "linux_x64"

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