-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Error accessing static field from nested function. #39929
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
Comments
@rbehrends Please notice that NNBD is still in implementation phase in the VM. |
@liamappelbe, could this be related to your recent work on late fields? |
Yeah, I know that. I reported it anyway, because it didn't look like something that was simply a gap in the implementation (unlike, say, type inference for |
Strange that the error happens only when running from the generated app-jit snapshot, are we not serializing some field or NNBD info into the snapshot? |
I am not able to reproduce this issue on linux with the latest build. Here are my steps:
No error reported. Note that if use a non-nnbd version of dart, I get an error:
Could that be the problem here? BTW, @liamappelbe, it looks like the error message has the required and expected features swapped, no? |
Never mind, I was not reading the error message correctly. "Snapshot" in the error message does not refer to the snapshot we are trying to generate (requiring nnbd), but to the platform snapshot (missing nnbd) that the VM is running on. |
Tried the test on bleeding edge and it works. |
This crash is a bit of a doozy, especially as it seems to occur only under very specific circumstances:
This bug happens only with
--enable-experiment=non-nullable
. It happens with dart 2.7.0 and 2.8.0-dev.0.0, but not with dart 2.6.1, and only when generating anapp-jit
snapshot, not during normal execution.If you reduce the
loop
argument enough, eventually the bug also disappears.If you make the
list
field non-static, the bug disappears.If you remove the for loop in
iter()
, the bug also disappears.I can trigger the bug on both macOS & Linux.
Edit: reduced the example a bit more and narrowed the conditions where it happens further.
The text was updated successfully, but these errors were encountered: