Extraneous diagnostic for an argument of an invalid type in a const constructor invocation #60616
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.
Given the following:
The analyzer currently produces two diagnostics:
Both are reporting the same problem: that an int can't be assigned to a String.
There should only be one diagnostic because there's only one problem. Given that the problem has nothing to do with it being a
const
constructor, theconst_constructor_param_type_mismatch
should be suppressed.Also, the two diagnostics have different highlight ranges. The
argument_type_not_assignable
highlights the value0
, while theconst_constructor_param_type_mismatch
includes the argument name in the range (string: 0
). Given that there's nothing wrong with the argument name,const_constructor_param_type_mismatch
should be changed to highlight only the value of the argument and not include the name.The text was updated successfully, but these errors were encountered: