Skip to content
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

[Enhanced enums] No error in CFE on user-written 'values' declaration #48387

Closed
sgrekhov opened this issue Feb 14, 2022 · 0 comments
Closed

[Enhanced enums] No error in CFE on user-written 'values' declaration #48387

sgrekhov opened this issue Feb 14, 2022 · 0 comments
Assignees
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues.

Comments

@sgrekhov
Copy link
Contributor

The following co19 test fails on CFE

enum E1<T> {
  e1,
  e2,
  e3;

  static int values = 42;
//           ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}

enum E2<T> {
  e1,
  e2,
  e3;

  static final int values = 42;
//                 ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}

enum E3<T> {
  e1<int>(1),
  e2<String>("2"),
  e3<bool>(true);

  const E3(Object val);
  static List<E3> values = [];
//                ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}

enum E4<T> {
  e1<int>(1),
  e2<String>("2"),
  e3<bool>(true);

  const E4(Object val);
  static final List<E4> values = [];
//                      ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}

main() {
  E1.e1;
  E2.e1;
  E3.e1;
  E4.e1;
}

Expected errors are not reported in CFE but should be.

Tested on Dart SDK version: 2.17.0-edge.4fb3d2afcf424ff3f73d55fc1585c448cdaa8762 (be) (Thu Feb 10 03:16:20 2022 +0000) on "linux_x64"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues.
Projects
None yet
Development

No branches or pull requests

2 participants