Skip to content

[cfe] No error if factory extension type constructor redirects to a constructor with incompatible parameters #53209

Closed
@sgrekhov

Description

@sgrekhov

CFE doesn't report errors expected below

// SharedOptions=--enable-experiment=inline-class

extension type const ET1(int id) {
  ET1.c() : id = 0;
  factory ET1.f(int id) = ET1.c;
//                         ^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}

extension type ET2(int id) {
  ET2.n(int a, int b) : id = a + b;
  factory ET2.f(int id) = ET2.n;
//                        ^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}

main() {
  print(ET1);
  print(ET2);
}

This causes failure of LanguageFeatures/Extension-types/static_analysis_extension_types_A21_t06.dart in CFE

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @chloestefantsova@sgrekhov@johnniwinther

      Issue actions

        [cfe] No error if factory extension type constructor redirects to a constructor with incompatible parameters · Issue #53209 · dart-lang/sdk