handle deserializing metadata diagnostic targets

Change-Id: I47f747baf48d6fc3a0e04871990d0743dbbb41e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352560
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
This commit is contained in:
Jake Macdonald 2024-02-14 00:03:35 +00:00 committed by Commit Queue
parent 48cbd9b322
commit 2624743bdd
2 changed files with 5 additions and 3 deletions

View file

@ -501,9 +501,11 @@ extension DeserializerExtensions on Deserializer {
new DiagnosticMessage(message, target: target.asDiagnosticTarget),
TypeAnnotationImpl() =>
new DiagnosticMessage(message, target: target.asDiagnosticTarget),
MetadataAnnotationImpl() =>
new DiagnosticMessage(message, target: target.asDiagnosticTarget),
_ => throw new UnsupportedError(
'Unsupported target type ${target.runtimeType}, only Declarations '
'and TypeAnnotations are allowed.'),
'Unsupported target type ${target.runtimeType}, only Declarations, '
'TypeAnnotations, and Metadata are allowed.'),
};
}
}

View file

@ -85,7 +85,7 @@ class EnumField {
}
@JsonSerializable()
class EnumField {
class DuplicateJsonKey {
@JsonKey()
@JsonKey()
//^^^^^^^^^^