Skip to content

Commit

Permalink
Fix assembly lookup for type reference (IIDOptimizer) (#979)
Browse files Browse the repository at this point in the history
* swap argument orders and actually pass the namespace where we werent
  • Loading branch information
j0shuams authored Sep 2, 2021
1 parent c9b8e38 commit 6354547
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Perf/IIDOptimizer/SignatureGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions src/WinRT.Runtime/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ Copyright (C) Microsoft Corporation. All rights reserved.
-->
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)../'))" />
<!-- Disabling til issue https://github.com/microsoft/CsWinRT/issues/978 is resolved
<Import Project="$(MSBuildThisFileDirectory)../../nuget/Microsoft.Windows.CsWinRT.IIDOptimizer.targets" Condition="'$(TargetFramework)' != 'netstandard2.0'"/>
-->
</Project>

0 comments on commit 6354547

Please sign in to comment.