Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix assembly lookup for type reference (IIDOptimizer) #979

Merged
merged 8 commits into from
Sep 2, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>