Output: Handle explicit interface implementation of indexers correctly

This commit is contained in:
Katy Coe
2019-12-11 10:27:52 +01:00
parent d728421d12
commit b8df3d7100
5 changed files with 233 additions and 168 deletions

View File

@@ -271,7 +271,9 @@ namespace Il2CppInspector
// Indexer
else {
sb.Append("this[" + string.Join(", ", primary.DeclaredParameters.SkipLast(getAccess >= setAccess ? 0 : 1)
// Replace "Item" with "this" - preserves explicit interface implementations
sb.Append(prop.CSharpName[..^4] + "this");
sb.Append("[" + string.Join(", ", primary.DeclaredParameters.SkipLast(getAccess >= setAccess ? 0 : 1)
.Select(p => p.GetParameterString(scope, !SuppressMetadata, MustCompile))) + "] { ");
getBody = " => default;";
setBody = " {}";