Skip to content

[js_interop] No error if a class annotated by @JSExport() contains a non-primitive type #61379

@sgrekhov

Description

@sgrekhov

There is no expected error below.

import 'dart:js_interop';

@JSExport()
class C {
  final D d;
//      ^
// [analyzer] unspecified
// [web] unspecified
  C(this.d);
}

@JSExport()
class D {
  int bar() => 42;
}

void main() {
  print(C);
}

cc @srujzs

Dart SDK version: 3.10.0-edge.a79b7c6c3594bc30b2bb2160196a8c1b1b3bce00 (main) (Thu Aug 21 23:14:41 2025 -0700) on "linux_x64"

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-js-interopIssues that impact all js interop

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions