fix: Fixes timer migrations not compiling (#902)

This commit is contained in:
Kamron Batman 2021-12-28 13:48:48 -08:00 committed by GitHub
parent d0aa6320f7
commit 5019ce9694
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 1273 additions and 1209 deletions

View file

@ -37,12 +37,9 @@ namespace SerializationGenerator
foreach (var serializableProperty in properties)
{
var propertyType = serializableProperty.Type;
var type = compilation.GetTypeByMetadataName(propertyType)?.IsValueType == true
|| SymbolMetadata.IsPrimitiveFromTypeDisplayString(propertyType) && propertyType != "bool"
? $"{propertyType}{(serializableProperty.UsesSaveFlag == true ? "?" : "")}" : propertyType;
source.AppendLine($"{indent} internal readonly {type} {serializableProperty.Name};");
SerializableMigrationRulesEngine.Rules[serializableProperty.Rule].GenerateMigrationProperty(
source, compilation, $"{indent} ", serializableProperty
);
}
var innerIndent = $"{indent} ";
@ -100,7 +97,8 @@ namespace SerializationGenerator
source,
$"{innerIndent} ",
property,
"entity"
"entity",
true
);
source.AppendLine($"{innerIndent}}}\n{innerIndent}else\n{innerIndent}{{");
@ -114,7 +112,8 @@ namespace SerializationGenerator
source,
innerIndent,
property,
"entity"
"entity",
true
);
}
}