From 6354547f9ab8b04c20008ce22d74939833881217 Mon Sep 17 00:00:00 2001 From: Joshua Larkin <70237359+j0shuams@users.noreply.github.com> Date: Wed, 1 Sep 2021 17:58:07 -0700 Subject: [PATCH] Fix assembly lookup for type reference (IIDOptimizer) (#979) * swap argument orders and actually pass the namespace where we werent --- src/Perf/IIDOptimizer/SignatureGenerator.cs | 7 +++---- src/WinRT.Runtime/Directory.Build.targets | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Perf/IIDOptimizer/SignatureGenerator.cs b/src/Perf/IIDOptimizer/SignatureGenerator.cs index 185e06d6e..9aeccf5b7 100644 --- a/src/Perf/IIDOptimizer/SignatureGenerator.cs +++ b/src/Perf/IIDOptimizer/SignatureGenerator.cs @@ -30,8 +30,7 @@ enum SignatureType record BasicSignaturePart(SignatureType Type) : SignaturePart; sealed record GuidSignature(Guid IID) : SignaturePart; - - + sealed record CustomSignatureMethod(MethodReference Method) : SignaturePart; sealed record NonGenericDelegateSignature(Guid DelegateIID) : SignaturePart; @@ -74,7 +73,7 @@ public SignaturePart GetSignatureParts(TypeReference type) var typeDef = type.Resolve(); - var helperType = new TypeReference($"ABI.{typeDef.Namespace}", typeDef.Name, assembly.MainModule, typeDef.Module); + var helperType = new TypeReference($"ABI.{typeDef.Namespace}", typeDef.Name, typeDef.Module, assembly.MainModule); if (helperType.Resolve() is not null) { @@ -183,7 +182,7 @@ public SignaturePart GetSignatureParts(TypeReference type) private TypeReference CreateAuthoringMetadataTypeReference(TypeReference type) { - return new TypeReference($"ABI.Impl.{type.Name}", type.Name, assembly.MainModule, type.Module); + return new TypeReference($"ABI.Impl.{type.Namespace}", type.Name, type.Module, assembly.MainModule); } bool TryGetDefaultInterfaceTypeForRuntimeClassType(TypeReference runtimeClassTypeMaybe, [NotNullWhen(true)] out TypeReference? defaultInterface) diff --git a/src/WinRT.Runtime/Directory.Build.targets b/src/WinRT.Runtime/Directory.Build.targets index d52bcdaf7..c4c20d0a7 100644 --- a/src/WinRT.Runtime/Directory.Build.targets +++ b/src/WinRT.Runtime/Directory.Build.targets @@ -5,5 +5,7 @@ Copyright (C) Microsoft Corporation. All rights reserved. --> + \ No newline at end of file