As discussed in: #90519 both:
should utilize UnsafeAccessorAttribute to simplify the logic of accessing the internal static methods in Delegate and AssemblyBuilder respectfully.
This would additionally remove the need for Internal.Runtime.Augments.DynamicDelegateAugments forwarder and simplify the code in general.
For reference: similar refactoring has been done in: #89706
As discussed in: #90519 both:
DynamicDelegateLightup
runtime/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/DelegateHelpers.cs
Line 20 in b0d4502
ForceAllowDynamicCodeLightup
runtime/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/DelegateHelpers.cs
Line 31 in b0d4502
should utilize
UnsafeAccessorAttributeto simplify the logic of accessing the internal static methods inDelegateandAssemblyBuilderrespectfully.This would additionally remove the need for
Internal.Runtime.Augments.DynamicDelegateAugmentsforwarder and simplify the code in general.For reference: similar refactoring has been done in: #89706