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

[main] Update dependencies from dotnet/linker #66538

Merged
merged 6 commits into from
Mar 21, 2022
4 changes: 2 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,9 @@
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>7698a9a80c5f6270aa1122d79ce419c7b03f2498</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.ILLink.Tasks" Version="7.0.100-1.22160.1">
<Dependency Name="Microsoft.NET.ILLink.Tasks" Version="7.0.100-1.22168.6">
<Uri>https://github.com/dotnet/linker</Uri>
<Sha>5baeb5e08b4a5fd6995e6247c7cb41b673c5ecdc</Sha>
<Sha>5929598c16cd5d791eb33d4b5978f3140a136262</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Common" Version="1.0.0-prerelease.22160.1">
<Uri>https://github.com/dotnet/xharness</Uri>
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
<!-- Docs -->
<MicrosoftPrivateIntellisenseVersion>6.0.0-preview-20220104.1</MicrosoftPrivateIntellisenseVersion>
<!-- ILLink -->
<MicrosoftNETILLinkTasksVersion>7.0.100-1.22160.1</MicrosoftNETILLinkTasksVersion>
<MicrosoftNETILLinkTasksVersion>7.0.100-1.22168.6</MicrosoftNETILLinkTasksVersion>
<MicrosoftNETILLinkAnalyzerPackageVersion>$(MicrosoftNETILLinkTasksVersion)</MicrosoftNETILLinkAnalyzerPackageVersion>
<!-- ICU -->
<MicrosoftNETCoreRuntimeICUTransportVersion>7.0.0-preview.3.22157.1</MicrosoftNETCoreRuntimeICUTransportVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,16 @@ public virtual bool IsAssignableFrom([NotNullWhen(true)] Type? c)
return false;
}

// IL2085 is produced due to the "this" of the method not being annotated and used in effectively this.GetInterfaces()
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2085:UnrecognizedReflectionPattern",
Justification = "The GetInterfaces technically requires all interfaces to be preserved" +
"But this method only compares the result against the passed in ifaceType." +
"So if ifaceType exists, then trimming should have kept it implemented on any type.")]
// IL2075 is produced due to the BaseType not returning annotated value and used in effectively this.BaseType.GetInterfaces()
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2075:UnrecognizedReflectionPattern",
Justification = "The GetInterfaces technically requires all interfaces to be preserved" +
"But this method only compares the result against the passed in ifaceType." +
"So if ifaceType exists, then trimming should have kept it implemented on any type.")]
internal bool ImplementInterface(Type ifaceType)
{
Type? t = this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,7 @@ private void InternalSerialize(MethodInfo methodInfo, LocalBuilder memberValue,
_ilg.Call(methodInfo);
}

[RequiresUnreferencedCode(DataContract.SerializerTrimmerWarning)]
private LocalBuilder UnwrapNullableObject(LocalBuilder memberValue)// Leaves !HasValue on stack
{
Type memberType = memberValue.LocalType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1196,12 +1196,13 @@ private static void PopulateMemberInfos(StructMapping structMapping, MemberMappi
}
}

// The DynamicallyAccessedMemberTypes.All annotation is required here because the method
// tries to access private members on base types (which is normally blocked by reflection)
// This doesn't make the requirements worse since the only callers already have the type
// annotated as All anyway.
private static bool ShouldBeReplaced(
MemberInfo memberInfoToBeReplaced,
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties
| DynamicallyAccessedMemberTypes.NonPublicProperties
| DynamicallyAccessedMemberTypes.PublicFields
| DynamicallyAccessedMemberTypes.NonPublicFields)] Type derivedType,
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type derivedType,
out MemberInfo replacedInfo)
{
replacedInfo = memberInfoToBeReplaced;
Expand Down