dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.25k stars 1.58k forks source link

package:js subtype checks inconsistent at compile-time and don't respect transitivity #56386

Open srujzs opened 3 months ago

srujzs commented 3 months ago

Similar issue in DDC: https://github.com/dart-lang/sdk/issues/56384. The effect can be seen in tests/web/internal/javascriptobject_extensions_test.dart.

There seems to be two central issues:

We should try and get the expectations aligned across both compiler and all of these tests working with the expected expectation (currently, the expectations are just the current status to make the test pass and avoid regressions).

cc @fishythefish @nshahan

dart-github-bot commented 3 months ago

Summary: Subtype checks using package:js are inconsistent between compile-time and runtime, and don't always respect transitivity. This is due to SSA optimizations and missing interceptor types in dart2js, leading to incorrect type checks and failing tests.