Front end: Confusing error message with Null typed condition #41384
Labels
area-front-end
Use area-front-end for front end / CFE / kernel format related issues.
improve-diagnostics
Related to the quality of diagnostic messages
Consider the following program:
At commit 28c4c6c (Apr 8), we get the following response from
dart
with null-safety:The type
Null?
seems to arise because its nullability is 'nullable', but the notation is confusing because there is no?
onNull
in any relevant location in the program. The reference to a variable is misleading because there are no variables.A similar error message is emitted if we introduce
Null n = null
and useif (n) {}
.The text was updated successfully, but these errors were encountered: