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

Loosen restrictions on package:js/Native type conflicts to nearly empty classes #46393

Open
srujzs opened this issue Jun 17, 2021 · 1 comment
Assignees
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. pkg-js web-js-interop Issues that impact all js interop

Comments

@srujzs
Copy link
Contributor

srujzs commented Jun 17, 2021

Currently, package:js has checks to make sure that the class being bound to in a @JS() annotation doesn't conflict with an @Native class. For context, #44211 pointed out issues with treating native types as interop types today.

Instead of issuing an error for any interop use, we only need to issue an error for when there are instance members within the interop class that aren't external constructors. This will allow users to declare static extension methods on the interop'd class and use native types with interop statically.

@srujzs srujzs added web-js-interop Issues that impact all js interop pkg-js area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. labels Jun 17, 2021
@srujzs srujzs self-assigned this Jun 17, 2021
@srujzs srujzs added this to Backlog - affects current JS interop only in Dart Web - JS Interop via automation Jun 17, 2021
@sigmundch
Copy link
Member

Note: we will also need to change to the subtyping rules in ddc and dart2js runtimes to allow assignments from native types to this kind of "empty" js-interop types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. pkg-js web-js-interop Issues that impact all js interop
Projects
Dart Web - JS Interop
Backlog - affects current JS interop ...
Development

No branches or pull requests

2 participants