C#: Don't output field offsets for open generic types

This commit is contained in:
Katy Coe
2020-02-28 11:01:38 +01:00
parent c0e90f2e9c
commit 40ab603c56

View File

@@ -373,7 +373,8 @@ namespace Il2CppInspector.Outputs
sb.Append($" = {field.DefaultValueString}");
sb.Append(";");
// Don't output field indices for const fields (they don't have any storage)
if (!field.IsLiteral && !SuppressMetadata)
// or open generic types (they aren't known until runtime)
if (!field.IsLiteral && !SuppressMetadata && !type.ContainsGenericParameters)
sb.Append($" // 0x{(uint) field.Offset:X2}");
// Output metadata file offset for const fields
if (field.IsLiteral && !SuppressMetadata)