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

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

Closed
sgrekhov opened this issue Oct 26, 2023 · 0 comments
Closed
Assignees
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. cfe-feature-extension-types Implement extension types feature in the CFE

Comments

@sgrekhov
Copy link
Contributor

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"

@sgrekhov sgrekhov added area-front-end Use area-front-end for front end / CFE / kernel format related issues. cfe-feature-extension-types Implement extension types feature in the CFE labels Oct 26, 2023
@chloestefantsova chloestefantsova self-assigned this Oct 27, 2023
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. cfe-feature-extension-types Implement extension types feature in the CFE
Projects
None yet
Development

No branches or pull requests

2 participants