Skip to content

[CFE][Extension type] Representation type can be subtype of a supertype #53867

Closed
@sgrekhov

Description

@sgrekhov

Extension type spec was recently relaxed and now allows representation type to be a subtype of a superinterface. So the following test should work (but it doesn't in the current CFE)

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

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

extension type V1(num _) {}

extension type V2(int _) implements V1 {}

extension type ET(V2 id) implements V1 {}

main() {
  Expect.equals(42, ET(V2(42)).id);
}

Related analyzer issue #53866

Tested on Dart SDK version: 3.3.0-edge.3a41ee6d8d01bb7bfc873c8b7fa700778574ebed (be) (Thu Oct 26 08:11:11 2023 +0000) on "macos_x64"

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @chloestefantsova@sgrekhov

      Issue actions

        [CFE][Extension type] Representation type can be subtype of a supertype · Issue #53867 · dart-lang/sdk