C#: Fix regression in indexer name output

This commit is contained in:
Katy Coe
2020-09-13 12:04:47 +02:00
parent 0b97a78a8d
commit 8e00e47ccd

View File

@@ -440,7 +440,7 @@ namespace Il2CppInspector.Outputs
else {
// Replace indexer name (usually "Item" but not always) with "this" - preserves explicit interface implementations
if (prop.CSharpName.IndexOf('.') != -1)
sb.Append(prop.CSharpName.Substring(0, prop.CSharpName.IndexOf('.') + 1));
sb.Append(prop.CSharpName.Substring(0, prop.CSharpName.LastIndexOf('.') + 1));
sb.Append("this[" + string.Join(", ", primary.DeclaredParameters.SkipLast(getAccess >= setAccess ? 0 : 1)
.Select(p => p.GetParameterString(scope, !SuppressMetadata, MustCompile))) + "] { ");
getBody = " => default;";