Skip to content

[pkg:js] Disallow users from using synthetic constructors for @staticInterop #49941

Closed
@srujzs

Description

@srujzs

Currently, users can write interop classes and call synthetic constructors and they will hit no checks. In the Wasm case, generative constructors are a pain point, so a synthetic constructor should be disallowed. Synthetic constructors should compile to the same code as factories with and without the @anonymous annotation. We should check for invocations of synthetic constructors and disallow them and advise them to use non-synthetic constructors instead.

Related:

#48730
#49350

cc @sigmundch @joshualitt

Metadata

Metadata

Assignees

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