Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
vitek-karas committed Sep 8, 2021
1 parent f57886e commit 715cf5a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/linker/Linker.Steps/SweepStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,11 @@ void UpdateScopeOfTypeReference (TypeReference type)
// Resolve to type definition to remove any type forwarding imports
//
// Workaround for https://github.com/mono/linker/issues/2260
// Context has a cache which stores ref->def mapping. This code runs during sweeping
// which can remove the type-def from its assembly, effectively making the ref unresolvable.
// But the cache doesn't know that, it would still "resolve" the type-ref to now defunct type-def.
// For this reason we can't use the context resolution here, and must force Cecil to perform
// real type resolution again (since it can fail, and that's OK).
#pragma warning disable RS0030 // Do not used banned APIs
TypeDefinition td = type.Resolve ();
#pragma warning restore RS0030 // Do not used banned APIs
Expand Down

0 comments on commit 715cf5a

Please sign in to comment.