Skip to content

Commit df352eb

Browse files
authored
Import explicit interface type (SamboyCoding#368)
1 parent 714c262 commit df352eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Cpp2IL.Core/Utils/AsmResolver/AsmResolverAssemblyPopulator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ private static void InferExplicitInterfaceImplementations(TypeDefinition type, R
596596

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

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

612612
if (SignatureComparer.Default.Equals(method.Signature, interfaceMethodDef.Signature?.InstantiateGenericTypes(genericContext)))
613613
{
614-
interfaceMethod = new MemberReference(interfaceType?.ToTypeDefOrRef(), interfaceMethodDef.Name, interfaceMethodDef.Signature);
614+
interfaceMethod = new MemberReference(importer.ImportTypeOrNull(interfaceType?.ToTypeDefOrRef()), interfaceMethodDef.Name, interfaceMethodDef.Signature);
615615
break;
616616
}
617617
}

0 commit comments

Comments
 (0)