fix: Mark weaver as failed if serializing invalid type

This commit is contained in:
Paul Pacheco 2019-04-07 15:45:09 -05:00
parent f310c61405
commit 03c767db6a

View File

@ -106,7 +106,7 @@ public static MethodReference GetReadFunc(TypeReference variable, int recursionC
if (newReaderFunc == null) if (newReaderFunc == null)
{ {
Log.Error("GetReadFunc unable to generate function for:" + variable.FullName); Weaver.Error("GetReadFunc unable to generate function for:" + variable.FullName);
return null; return null;
} }
RegisterReadFunc(variable.FullName, newReaderFunc); RegisterReadFunc(variable.FullName, newReaderFunc);
@ -126,7 +126,7 @@ static MethodDefinition GenerateArrayReadFunc(TypeReference variable, MethodRefe
{ {
if (!variable.IsArrayType()) if (!variable.IsArrayType())
{ {
Log.Error(variable.FullName + " is an unsupported array type. Jagged and multidimensional arrays are not supported"); Weaver.Error(variable.FullName + " is an unsupported array type. Jagged and multidimensional arrays are not supported");
return null; return null;
} }
string functionName = "_ReadArray" + variable.GetElementType().Name + "_"; string functionName = "_ReadArray" + variable.GetElementType().Name + "_";
@ -251,7 +251,7 @@ static MethodDefinition GenerateStructReadFunction(TypeReference variable, int r
MethodDefinition ctor = Resolvers.ResolveDefaultPublicCtor(variable); MethodDefinition ctor = Resolvers.ResolveDefaultPublicCtor(variable);
if (ctor == null) if (ctor == null)
{ {
Log.Error("The class " + variable.Name + " has no default constructor or it's private, aborting."); Weaver.Error("The class " + variable.Name + " has no default constructor or it's private, aborting.");
return null; return null;
} }