Skip to content

[Enhanced enums] Getter/setter signature mismatch error not detected #48296

Closed
@sgrekhov

Description

@sgrekhov

The following co19 test fails in analyzer https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Enhanced-Enum/semantics_A09_t11.dart

enum E1 {
  e1,
  e2,
  e3;

  static void set e1(int val) {}
//                   ^^^
// [analyzer] unspecified
// [cfe] unspecified
}

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

  const E2(T t);
  static void set e1(E2<String> val) {}
//                      ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
  static void set e2(E2<bool> val) {}
//                      ^^^^
// [analyzer] unspecified
// [cfe] unspecified
  static void set e3(E2<int> val) {}
//                      ^^^
// [analyzer] unspecified
// [cfe] unspecified
}

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

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

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work ondart-model-analyzer-specIssues with the analyzer's implementation of the language speclegacy-area-analyzerUse area-devexp instead.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions