Skip to content

[analyzer][Extension type] Representation type can be subtype of a supertype #53866

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

Closed
sgrekhov opened this issue Oct 26, 2023 · 2 comments
Closed
Assignees
Labels
feature-extension-types Implementation of the extension type feature legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on

Comments

@sgrekhov
Copy link
Contributor

sgrekhov commented Oct 26, 2023

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 analyzer)

// 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 CFE issue #53867

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 legacy-area-analyzer Use area-devexp instead. feature-extension-types Implementation of the extension type feature labels Oct 26, 2023
@bwilkerson bwilkerson added the P2 A bug or feature request we're likely to work on label Oct 26, 2023
@bwilkerson
Copy link
Member

@scheglov

@scheglov scheglov self-assigned this Oct 26, 2023
@scheglov
Copy link
Contributor

copybara-service bot pushed a commit that referenced this issue Oct 26, 2023
…subtype of implemented extension type.

Bug: #53866
Change-Id: Ic3ac0556695c8ffbb8a4545777ea07a8b52c1e76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332363
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Konstantin Shcheglov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-extension-types Implementation of the extension type feature legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

3 participants