Open julemand101 opened 1 month ago
Summary: The analyzer and compiler produce different error messages when a nullable boolean (bool?
) is used in an if
statement. The analyzer correctly identifies the issue as an unchecked use of a nullable value, while the compiler incorrectly suggests a type assignment error.
@bwilkerson: not sure about triaging this one; could you take a look?
Reproduced with the following:
Code:
Output from
dart analyze
:Output from
dart .\bin\advent_of_code_2022.dart
:I feel the error message from the compiler are kinda misleading since it tells about some variable assignment which are confusing since there are no variable being assigned in
if (b) {}
. The analyzer are more clear about what is going on.