-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 crash on local function type variables. #51899
Comments
Thanks @lrhn - seems like dart2js has never added support for type variables on local functions. While I agree that should be fixed, it would be a shame to not have test coverage in dart2js for your new changes because of this (especially since your feature doesn't relate to this issue). In the meantime, would you consider a small refactor on the test to avoid this feature? I'll comment on your CL as well. |
Are we sure it doesn't support local generic functions at all. The But I'll rewrite the test and see if it helps. |
Sorry, you are right, I just jumped to conclusions too quickly by looking at the error message above. |
mmm... I was not able to repro the crash after I patched your CL locally. Do you know if it is still failing on your CL? |
Ah, never mind - I saw most closures were still around and I didn't notice that you did hoist |
It appears the issue is directly related to records. Here is a minimal repro: void main() {
void f<T>(T value, (int, T) record) {
(0, value) == record;
}
f("a", (0, "a"));
} Which crashes with the following error:
|
cc @rakudrama |
It appears related to the creation of the inner record. Here is an even simpler repro: void main() {
Object? f<T>(T value) => (0, value);
f("a");
} |
I marked this as P1 for our team, since it's a crasher, but I don't consider this a blocker for the milestone. Feel free to move it out of the milestone as we approach the deadline. |
This cherry-picks a fix for a dart2js crash onto the stable channel. For more information see #52216 === original commit message === [dart2js] Convert recordTypes after closureData Bug #51899 Change-Id: Id9108e6cf13aee409b127fe6cd007bef8f0fe609 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298460 Reviewed-by: Sigmund Cherem <[email protected]> Reviewed-by: Mayank Patke <[email protected]> Commit-Queue: Stephen Adams <[email protected]> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302801 Commit-Queue: Sigmund Cherem <[email protected]>
I received the error
when trying to run a new test.
It's only test code, not the code being tested, so I'll pre-approve the failure for now.
It's coming from
js_world_builder.dart
:but if it's reachable from user code, then it's a bug.
The text was updated successfully, but these errors were encountered: