Closed eernstg closed 4 years ago
I am not sure why it works in dartanalyzer, but these errors are produced by the front-end. I am reassigning the issue.
See also #39461
Never mind :-) Having a second look.
Although the type Never is always non-nullable, the CFE writes a nullability byte in kernel files that was not properly skipped by the VM. A CL is under review.
Consider the following two programs:
Both of them cause a crash in
dart
from commit 11d523dfe11dbf61a46f04b32d31c6181fcf073f (butdartanalyzer
accepts the programs):The NNBD specification indicates that
Never
is declared in 'dart:core', so both should work.The following form causes the same crash (before execution starts), so it isn't caused by the use of
throw "away"
as an initializing expression: