Miista / pose

Replace any .NET method (including static and non-virtual) with a delegate
MIT License
25 stars 3 forks source link

Cannot shim constrained virtual method call on .NET 6+ #49

Open Miista opened 7 months ago

Miista commented 7 months ago

See test Can_shim_constrained_virtual_method_of_any_instance which has been disabled on .NET 6 and upwards. The test code is currently only in branch https://github.com/Miista/pose/tree/31-add-support-for-shimming-operators

Miista commented 5 months ago

It seems that this might be caused by the constrained opcode not being emitted. It is, however, weird that this is only an issue on .NET 6 and upwards.

I think an approach would be to write the code by hand and see how it gets translated into IL.