Change conversion diagnostic from saying "value" to "expression" (#5221)

Avoids TODO to make the message change based on the expression category.

Co-authored-by: Josh L <josh11b@users.noreply.github.com>
This commit is contained in:
josh11b
2025-03-31 15:45:58 +00:00
committed by GitHub
co-authored by Josh L
parent 97b234358e
commit 384be1dbe3
42 changed files with 62 additions and 64 deletions
+2 -4
View File
@@ -1288,11 +1288,9 @@ auto Convert(Context& context, SemIR::LocId loc_id, SemIR::InstId expr_id,
return DiagnoseConversionFailureToConstraintValue(context, loc_id,
expr_id, target);
} else {
// TODO: Should this message change to say "object of type" when
// converting from a reference expression?
CARBON_DIAGNOSTIC(ConversionFailure, Error,
"cannot{0:| implicitly} convert value of type {1} to "
"{2}{0: with `as`|}",
"cannot{0:| implicitly} convert expression of type "
"{1} to {2}{0: with `as`|}",
Diagnostics::BoolAsSelect, TypeOfInstId,
SemIR::TypeId);
return context.emitter().Build(