CS: Fix enumeration scoping on default field values (CS0103)

This commit is contained in:
Katy Coe
2020-06-22 18:38:16 +02:00
parent 2791721dd1
commit ef22c6628b
2 changed files with 2 additions and 2 deletions

View File

@@ -390,7 +390,7 @@ namespace Il2CppInspector.Outputs
else
sb.Append($"{field.FieldType.GetScopedCSharpName(scope)} {field.CSharpSafeName}");
if (field.HasDefaultValue)
sb.Append($" = {field.DefaultValueString}");
sb.Append($" = {field.GetDefaultValueString(scope)}");
sb.Append(";");
// Don't output field indices for const fields (they don't have any storage)
// or open generic types (they aren't known until runtime)