Poor problem and correction messages related to assignability #60516
Labels
area-dart-model
For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.
model-messages
Poor/undesirable messaging in errors/warnings emitted by the analyzer and/or CFE.
P3
A lower priority bug or feature request
Consider the following code:
On the marked line there will be a diagnostic of the following form:
While the problem message is technically correct, it would be helpful to have a slightly different message for this particular case, perhaps something of the form
The correction, or the second half of it, is not correct. Casting the right-hand side will silence the diagnostic by turning it into a runtime exception. Better advice would be something along the lines of
The text was updated successfully, but these errors were encountered: