From 1c411ff12dd3577c7a9f97b4b382b844199cc492 Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Sun, 10 Nov 2019 00:18:08 +0100 Subject: [PATCH] Output: Fix failure to render indexer argument in some cases --- Il2CppDumper/Il2CppCSharpDumper.cs | 2 +- Il2CppTests/TestExpectedResults/Properties.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Il2CppDumper/Il2CppCSharpDumper.cs b/Il2CppDumper/Il2CppCSharpDumper.cs index 682915e..6345340 100644 --- a/Il2CppDumper/Il2CppCSharpDumper.cs +++ b/Il2CppDumper/Il2CppCSharpDumper.cs @@ -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; " : "") diff --git a/Il2CppTests/TestExpectedResults/Properties.cs b/Il2CppTests/TestExpectedResults/Properties.cs index 58f2e5c..d7bebd8 100644 --- a/Il2CppTests/TestExpectedResults/Properties.cs +++ b/Il2CppTests/TestExpectedResults/Properties.cs @@ -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