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

[analyzer] Analyzer disallows external fields on extension types #53226

Closed
srujzs opened this issue Aug 15, 2023 · 2 comments
Closed

[analyzer] Analyzer disallows external fields on extension types #53226

srujzs opened this issue Aug 15, 2023 · 2 comments
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request

Comments

@srujzs
Copy link
Contributor

srujzs commented Aug 15, 2023

Analysis on the following example:

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

import 'dart:js_interop';

extension type E._(JSObject _) {
  external String field;
}

void main() {}

fails with:

error • field_test.dart:6:19 • Extension types can't declare instance fields. Try replacing the field with a getter. • extension_type_declares_instance_field

Dart version:
Dart SDK version: 3.2.0-edge.820b0f799c8dc33ffde17431074a2abfcc5036cf (be) (Mon Aug 14 13:07:06 2023 -0400) on "macos_x64"

@srujzs srujzs added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label Aug 15, 2023
@eernstg
Copy link
Member

eernstg commented Aug 15, 2023

An external instance variable should be treated as an external getter and an external setter (if not final), so that should be allowed.

@bwilkerson bwilkerson added the P3 A lower priority bug or feature request label Aug 15, 2023
@sgrekhov
Copy link
Contributor

Seems that this issue was fixed.
Retested on Dart SDK version: 3.2.0-edge.09f7f356db63e99a43602e0d2e7061088b31991e (be) (Thu Sep 28 04:02:06 2023 +0000) on "linux_x64"
Closing this item
@srujzs feel free to reopen it if you believe that these is anything that still should be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request
Projects
None yet
Development

No branches or pull requests

4 participants