Skip to content

No error if an extension type implements an incompatible type #53170

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 Aug 10, 2023 · 2 comments
Closed

No error if an extension type implements an incompatible type #53170

sgrekhov opened this issue Aug 10, 2023 · 2 comments
Assignees
Labels
front-end-missing-error legacy-area-front-end Legacy: Use area-dart-model instead.

Comments

@sgrekhov
Copy link
Contributor

Expected error below is not reported nor by analyzer nor by CFE

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

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

extension type V(num id) implements V1<String> {}
//                                  ^^
// [analyzer] unspecified
// [cfe] unspecified

main() {
  print(V1);
  print(V);
}

Tested on Dart SDK version: 3.2.0-36.0.dev (dev) (Thu Aug 3 17:04:06 2023 -0700) on "windows_x64" and on the edge SDK (Aug 10, 2023) on Linux x64

@sgrekhov sgrekhov added legacy-area-analyzer Use area-devexp instead. legacy-area-front-end Legacy: Use area-dart-model instead. front-end-missing-error labels Aug 10, 2023
@sgrekhov
Copy link
Contributor Author

There is even simpler example below. Again, no error reported by analyzer and CFE

extension type V1(String id) {}

extension type V(num id) implements V1 {}
//             ^
// [analyzer] unspecified
// [cfe] unspecified

main() {
  print(V1);
  print(V);
}

@scheglov scheglov self-assigned this Aug 10, 2023
@scheglov scheglov added the P1 A high priority bug; for example, a single project is unusable or has many test failures label Aug 10, 2023
@scheglov
Copy link
Contributor

Fixed in 53cccf9, in the analyzer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
front-end-missing-error legacy-area-front-end Legacy: Use area-dart-model instead.
Projects
None yet
Development

No branches or pull requests

3 participants