-
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
NNBD. Dart crashes on late variables #39658
Comments
Interesting. This is only reproducible if the late variable is a double. Ints and classes work fine. |
It seems that when doubles are unboxed it messes with the late field logic. So the fix is just to disable unboxing for late fields, like we do for final fields. |
@liamappelbe, I have one more test that produces a CRASH on late variables, but without class C {
static late final int s = 42;
// ^^^^
// [analyzer] unspecified
// [cfe] unspecified
late final int i = 42;
//^^^^
// [analyzer] unspecified
// [cfe] unspecified
const C();
}
main() {
C();
} Does your fix fixes this issue as well? If need I can create a separate issue for this, just let me know |
@liamappelbe One more crash on late for strings class A {
String s;
A(this.s);
}
class C {
A a = new A("Lily was here");
late A a1 = this.a;
}
main() {
new C().a1;
} Is this a separate issue? |
The first one sounds like an analyzer bug, so file a separate issue (other people are working on that part). The second one works for me, with or without the fix in e20ff1e, so that's a separate issue. Can you try syncing to head and file a bug if it's reproducible? |
There are no crash any longer for all of the cases mentioned above. Tested on Dart VM version: 2.8.0-dev.0.0 (Wed Dec 11 10:31:10 2019 +0100) on "windows_x64". Thank you. |
Run this code in dart with --enable-experiment=non-nullable flag and there will be a crach! Tested on
Dart VM version: 2.7.0-dev.2.1 (Mon Dec 2 20:10:59 2019 +0100) on "windows_x64"
Dart VM version: 2.7.0-dev.2.1 (Unknown timestamp) on "linux_x64"
The text was updated successfully, but these errors were encountered: