Skip to content

[cfe] Wrong type of extension type constructors tear-off #53211

Closed
@sgrekhov

Description

@sgrekhov

The following test fails in CFE (works in Analyzer)

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

import "../../Utils/static_type_helper.dart";

extension type ET1(int id) {}

extension type ET2<T>(T id) {}

extension type ET3.new(int id) {}

extension type ET4<T>.new(T id) {}

extension type ET5.n(int id) {}

extension type ET6<T>.n(T id) {}

main() {
  ET1.new.expectStaticType<Exactly<ET1 Function(int)>>();
  ET2<String>.new.expectStaticType<Exactly<ET2<String> Function(String)>>();
  ET3.new.expectStaticType<Exactly<ET3 Function(int)>>();
  ET4<String>.new.expectStaticType<Exactly<ET4<String> Function(String)>>();
  ET5.n.expectStaticType<Exactly<ET5 Function(int)>>();
  ET6<String>.n.expectStaticType<Exactly<ET6<String> Function(String)>>();
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions