Output: Auto-properties must have get accessors (CS8051)

This commit is contained in:
Katy Coe
2019-12-10 14:22:13 +01:00
parent 46acc1b5a7
commit be52e7d201
3 changed files with 4 additions and 2 deletions

View File

@@ -278,6 +278,8 @@ namespace Il2CppInspector
sb.Append((prop.CanRead? prop.GetMethod.CustomAttributes.Where(a => !MustCompile || a.AttributeType.FullName != CGAttribute)
.ToString(scope, inline: true, emitPointer: !SuppressMetadata, mustCompile: MustCompile)
+ (getAccess < setAccess? prop.GetMethod.GetAccessModifierString() : "") + $"get{getBody} " : "")
// Auto-properties must have get accessors
+ (MustCompile && !prop.CanRead? "get; " : "")
+ (prop.CanWrite? prop.SetMethod.CustomAttributes.Where(a => !MustCompile || a.AttributeType.FullName != CGAttribute)
.ToString(scope, inline: true, emitPointer: !SuppressMetadata, mustCompile: MustCompile)
+ (setAccess < getAccess? prop.SetMethod.GetAccessModifierString() : "") + $"set{setBody} " : "") + "}");