FastGenericNew icon indicating copy to clipboard operation
FastGenericNew copied to clipboard

Question: why use Reflection.Emit while we can just invoke type directly

Open NotAsea opened this issue 1 year ago • 0 comments

While browsing along source generated code, i notice you use System.Reflection.Emit and emit IL directly through delegate. The question is why?, i thought this package suppose to be NativeAOT friendly but System.Reflection.Emit is causing trouble in trimming. Why cant we just invoke type constructor directly. Isn't generate code calling type constructor is fastest?

NotAsea avatar Jan 14 '25 15:01 NotAsea