Skip to content

[analyzer] No error if an extension type declares getter and setter with the same basename but with uncompatible types #53489

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
Tracked by #49732
sgrekhov opened this issue Sep 11, 2023 · 2 comments
Assignees
Labels
feature-extension-types Implementation of the extension type feature legacy-area-analyzer Use area-devexp instead. P1 A high priority bug; for example, a single project is unusable or has many test failures

Comments

@sgrekhov
Copy link
Contributor

Analyzer doesn't report an error if an extension type declares an instance getter and setter with incompatible types.
For example the following errors are not reported.

extension type ET1(int id) {
  void set x(String i) {}
  int get x => 42;
//        ^
// [analyzer] unspecified
// [cfe] unspecified   
}

extension type ET2(int id) {
  void set id(String i) {} // conflict with the type of representation variable getter
//         ^^
// [analyzer] unspecified
// [cfe] unspecified
}

cc @eernstg to confirm that extension type should behave like a regular class here
Tested on the edge SDK (Sept 11, 2023) on Linux x64

@sgrekhov sgrekhov added legacy-area-analyzer Use area-devexp instead. feature-extension-types Implementation of the extension type feature labels Sep 11, 2023
@eernstg
Copy link
Member

eernstg commented Sep 11, 2023

Yes, that error should be reported.

Cf. dart-lang/language#3338.

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

This was fixed in 08c0108.

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. P1 A high priority bug; for example, a single project is unusable or has many test failures
Projects
None yet
Development

No branches or pull requests

3 participants