Skip to content

Commit

Permalink
Merge pull request #48 from js6pak/dont-interop-overrides
Browse files Browse the repository at this point in the history
Don't generate interop methods for interface overrides
  • Loading branch information
ghorsington authored Oct 4, 2022
2 parents adbad51 + b80b20c commit 857a8a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Il2CppInterop.Generator/Contexts/TypeRewriteContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public void AddMembers()
if (originalTypeMethod.Name == ".cctor") continue;
if (originalTypeMethod.Name == ".ctor" && originalTypeMethod.Parameters.Count == 1 &&
originalTypeMethod.Parameters[0].ParameterType.FullName == "System.IntPtr") continue;
if (originalTypeMethod.HasOverrides) continue;

var methodRewriteContext = new MethodRewriteContext(this, originalTypeMethod);
myMethodContexts[originalTypeMethod] = methodRewriteContext;
Expand Down
2 changes: 2 additions & 0 deletions Il2CppInterop.Generator/Passes/Pass70GenerateProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public static void DoPass(RewriteGlobalContext context)

foreach (var oldProperty in type.Properties)
{
if ((oldProperty.GetMethod?.HasOverrides ?? false) || (oldProperty.SetMethod?.HasOverrides ?? false)) continue;

var unmangledPropertyName = UnmanglePropertyName(assemblyContext, oldProperty, typeContext.NewType,
propertyCountsByName);

Expand Down

0 comments on commit 857a8a0

Please sign in to comment.