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

[dart2js] Numeric record type tests give different results at compile time vs. runtime #52619

Closed
fishythefish opened this issue Jun 5, 2023 · 3 comments
Assignees
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js

Comments

@fishythefish
Copy link
Member

@pragma('dart2js:never-inline')
bool test<T>(dynamic x) => x is T;

void main() {
  print(1 is double);
  print(test<double>(1));

  print((1,) is (double,));
  print(test<(double,)>((1,)));
}

This prints

true
true
false
true

cc @rakudrama @biggs0125

@fishythefish fishythefish added web-dart2js type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. labels Jun 5, 2023
@fishythefish
Copy link
Member Author

Note that the direct is tests are compiled to print(true) and print(false). There's probably a bug here somewhere.

@sigmundch
Copy link
Member

Thanks @fishythefish!

BTW - I also came across this when debugging this other issue: #52480

@biggs0125 biggs0125 self-assigned this Jun 5, 2023
@biggs0125
Copy link

I can take a look at this if no one has started digging in yet!

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. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js
Projects
None yet
Development

No branches or pull requests

3 participants