Closed
Description
The following code is accept without complaint by the VM but crashes the analyzer:
abstract class C {
int? get x;
}
int f(bool b, C? c) {
if (b) {
return c?.x!;
} else {
return 0;
}
}
main() {
print(f(false, null));
}
I believe what is happening is that the analyzer gets confused about whether the !
should terminate null shorting (it should), and as a result break invariants of flow analysis; this in turn causes a crash when it tries to close the "then" branch of the "if" statement. I'm preparing a fix.