Output: Don't force indexers to have get accessors

This commit is contained in:
Katy Coe
2019-12-10 14:32:54 +01:00
parent be52e7d201
commit f78e2b3c54

View File

@@ -278,8 +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; " : "")
// Auto-properties must have get accessors (exclude indexers)
+ (MustCompile && !prop.CanRead && setBody == ";"? "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} " : "") + "}");