[messages] Fix error message.

Fixes the error message emitted by
`MessageWithAnalyzerCode.decodeType` if the type of the YAML node is
not a string.

Change-Id: I6a6a6964a5ad3f5dad1913ec37b77ceecc0bd576
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/465968
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
Paul Berry
2025-12-04 05:24:01 -08:00
committed by Commit Queue
parent 702b0250ac
commit 20c1d3af9d
@@ -729,6 +729,6 @@ LocatableDiagnostic $withArgumentsName({$withArgumentsParams}) {
YamlScalar(:String value) =>
AnalyzerDiagnosticType.fromString(value) ??
(throw 'Unknown analyzer diagnostic type'),
_ => throw 'Must be a bool',
_ => throw 'Must be a string',
};
}