Output: Fix failure to render indexer argument in some cases

This commit is contained in:
Katy Coe
2019-11-10 00:18:08 +01:00
parent 192ad0b520
commit 1c411ff12d
2 changed files with 2 additions and 2 deletions

View File

@@ -222,7 +222,7 @@ namespace Il2CppInspector
writer.Write($"{prop.Name} {{ ");
// Indexer
else
writer.Write("this[" + string.Join(", ", primary.DeclaredParameters.SkipLast(getAccess > setAccess? 0 : 1).Select(p => p.GetParameterString())) + "] { ");
writer.Write("this[" + string.Join(", ", primary.DeclaredParameters.SkipLast(getAccess >= setAccess? 0 : 1).Select(p => p.GetParameterString())) + "] { ");
writer.Write((prop.CanRead? prop.GetMethod.CustomAttributes.Where(a => !SuppressGenerated || a.AttributeType.FullName != CGAttribute).ToString(inline: true)
+ (getAccess < setAccess? prop.GetMethod.GetAccessModifierString() : "") + "get; " : "")

View File

@@ -14,7 +14,7 @@ internal class Test // TypeDefIndex: 1811
public string this[int i] { get; } // 0x00561328
public string this[double d] { get; } // 0x00561384
public string this[long l] { set; } // 0x005613DC
public string this[] { get; set; } // 0x005613E0 0x0056143C
public string this[float f] { get; set; } // 0x005613E0 0x0056143C
public bool this[int i, int j] { get; } // 0x00561440
// Constructors