Skip to content

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

@srujzs

Description

@srujzs

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestlegacy-area-analyzerUse area-devexp instead.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions