From 7cc4e850794553b202d3deb353a378ea0089e61d Mon Sep 17 00:00:00 2001 From: vitek-karas Date: Tue, 7 Sep 2021 04:14:10 -0700 Subject: [PATCH] Workaround NRE in SweepStep Basically a workaround for #2260. This simply goes back to using the `Resolve` method and avoid the cache for now. --- src/linker/Linker.Steps/SweepStep.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/linker/Linker.Steps/SweepStep.cs b/src/linker/Linker.Steps/SweepStep.cs index cd9b17f3e3ad..c9415cfdb014 100644 --- a/src/linker/Linker.Steps/SweepStep.cs +++ b/src/linker/Linker.Steps/SweepStep.cs @@ -925,7 +925,10 @@ void UpdateScopeOfTypeReference (TypeReference type) // // Resolve to type definition to remove any type forwarding imports // - TypeDefinition td = resolver.TryResolve (type); + // Workaround for https://github.com/mono/linker/issues/2260 +#pragma warning disable RS0030 // Do not used banned APIs + TypeDefinition td = type.Resolve (); +#pragma warning restore RS0030 // Do not used banned APIs if (td == null) { // // This can happen when not all assembly refences were provided and we