You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Workaround] Remove unconditional TypeMap entries for skipped actual types when dotnet/runtime#127504 is fixed #25275
We have a workaround in tools/dotnet-linker/Steps/TrimmableRegistrarStep.cs for a bug in ILLink's TypeMapHandler (dotnet/runtime#127504).
What the workaround does
Types that are the "actual" (non-generic) target of SkippedObjectiveCTypeUniverse associations (e.g., NSOrderedSet, NSArray, NSDictionary) use the 2-arg (unconditional) TypeMapAttribute constructor instead of the 3-arg (conditional) one. This prevents the linker from incorrectly trimming their TypeMap entries.
Code to remove
In tools/dotnet-linker/Steps/TrimmableRegistrarStep.cs:
Delete the skippedActualTypes HashSet and its comment block.
Remove the if (skippedActualTypes.Contains (td)) branch, keeping only the else branch (the 3-arg constructor path).
Validation
cd tests/monotouch-test/dotnet/MacCatalyst
make build run-bare TEST_VARIATION='release|trimmable-static-registrar-all-optimizations-linkall' RUN_ARGUMENTS="--test MonoTouchFixtures.Foundation.NSOrderedSetTest"
The MakeNSOrderedSet_WithNull test is a good canary — it failed with InvalidCastException: Unable to cast object of type 'Foundation.NSObject' to type 'Foundation.NSOrderedSet' before the workaround.
Activity
[dotnet-linker] Gate the TypeMap workaround for dotnet/runtime#127504 …