mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 12:24:24 +00:00
Macro. Update JsonSerializable to use throw instead of invalid code.
Bug: https://github.com/dart-lang/sdk/issues/55005 Change-Id: I7ba716576ef5c4cb3aef1e4bd10c70824d39964a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354120 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Jake Macdonald <jakemac@google.com>
This commit is contained in:
parent
d310d84f7f
commit
fe41579bf6
1 changed files with 6 additions and 6 deletions
|
@ -179,7 +179,7 @@ macro class FromJson implements ConstructorDefinitionMacro {
|
|||
target: type.asDiagnosticTarget),
|
||||
Severity.error));
|
||||
return RawCode.fromString(
|
||||
'<Unable to deserialize type ${type.code.debugString}>');
|
||||
"throw 'Unable to deserialize type ${type.code.debugString}'");
|
||||
}
|
||||
var typeDecl = await builder.typeDeclarationOf(type.identifier);
|
||||
while (typeDecl is TypeAliasDeclaration) {
|
||||
|
@ -192,7 +192,7 @@ macro class FromJson implements ConstructorDefinitionMacro {
|
|||
target: type.asDiagnosticTarget),
|
||||
Severity.error));
|
||||
return RawCode.fromString(
|
||||
'<Unable to deserialize type ${type.code.debugString}>');
|
||||
"throw 'Unable to deserialize type ${type.code.debugString}'");
|
||||
}
|
||||
typeDecl = await builder.typeDeclarationOf(aliasedType.identifier);
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ macro class FromJson implements ConstructorDefinitionMacro {
|
|||
target: type.asDiagnosticTarget),
|
||||
Severity.error));
|
||||
return RawCode.fromString(
|
||||
'<Unable to deserialize type ${type.code.debugString}>');
|
||||
"throw 'Unable to deserialize type ${type.code.debugString}'");
|
||||
}
|
||||
|
||||
// The static type of the expected type, without any type arguments.
|
||||
|
@ -523,7 +523,7 @@ macro class ToJson implements MethodDefinitionMacro {
|
|||
target: type.asDiagnosticTarget),
|
||||
Severity.error));
|
||||
return RawCode.fromString(
|
||||
'<Unable to serialize type ${type.code.debugString}>');
|
||||
"throw 'Unable to serialize type ${type.code.debugString}'");
|
||||
}
|
||||
var typeDecl = await builder.typeDeclarationOf(type.identifier);
|
||||
while (typeDecl is TypeAliasDeclaration) {
|
||||
|
@ -535,7 +535,7 @@ macro class ToJson implements MethodDefinitionMacro {
|
|||
target: type.asDiagnosticTarget),
|
||||
Severity.error));
|
||||
return RawCode.fromString(
|
||||
'<Unable to serialize type ${type.code.debugString}>');
|
||||
"throw 'Unable to serialize type ${type.code.debugString}'");
|
||||
}
|
||||
typeDecl = await builder.typeDeclarationOf(aliasedType.identifier);
|
||||
}
|
||||
|
@ -546,7 +546,7 @@ macro class ToJson implements MethodDefinitionMacro {
|
|||
target: type.asDiagnosticTarget),
|
||||
Severity.error));
|
||||
return RawCode.fromString(
|
||||
'<Unable to serialize type ${type.code.debugString}>');
|
||||
"throw 'Unable to serialize type ${type.code.debugString}'");
|
||||
}
|
||||
|
||||
var typeDeclType = await builder.resolve(
|
||||
|
|
Loading…
Reference in a new issue