Closed
Description
I understand the following may be a tricky scenario for the analyzer, but just putting this here in case it can be fixed:
import 'dart:math' show Random;
void main() {
int? x;
if (Random().nextBool()) {
x = 5;
}
if (x == null) return;
void f() {
var y = x * 2; // The operator '*' can't be unconditionally invoked because the receiver can be 'null'.
print(y);
}
f();
}
f()
is never called when x
can be null
.
This issue probably exists in some form, but I couldn't find it.
Metadata
Metadata
Assignees
Labels
No labels