Skip to content

Commit

Permalink
Import explicit interface type (#368)
Browse files Browse the repository at this point in the history
  • Loading branch information
ds5678 authored Nov 5, 2024
1 parent 714c262 commit df352eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Cpp2IL.Core/Utils/AsmResolver/AsmResolverAssemblyPopulator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ private static void InferExplicitInterfaceImplementations(TypeDefinition type, R

// This has the implicit assumption that the method signatures match.
// This is a reasonable assumption because there's no other method to match (with this name).
interfaceMethod = new MemberReference(interfaceType.ToTypeDefOrRef(), interfaceMethodDef.Name, interfaceMethodDef.Signature);
interfaceMethod = new MemberReference(importer.ImportType(interfaceType.ToTypeDefOrRef()), interfaceMethodDef.Name, interfaceMethodDef.Signature);
}

if (ambiguous)
Expand All @@ -611,7 +611,7 @@ private static void InferExplicitInterfaceImplementations(TypeDefinition type, R

if (SignatureComparer.Default.Equals(method.Signature, interfaceMethodDef.Signature?.InstantiateGenericTypes(genericContext)))
{
interfaceMethod = new MemberReference(interfaceType?.ToTypeDefOrRef(), interfaceMethodDef.Name, interfaceMethodDef.Signature);
interfaceMethod = new MemberReference(importer.ImportTypeOrNull(interfaceType?.ToTypeDefOrRef()), interfaceMethodDef.Name, interfaceMethodDef.Signature);
break;
}
}
Expand Down

0 comments on commit df352eb

Please sign in to comment.