castleproject / Core

Castle Core, including Castle DynamicProxy, Logging Services and DictionaryAdapter
http://www.castleproject.org/
Other
2.2k stars 468 forks source link

Use standard invocation type for abstract methods of class proxies w/o target #626

Closed stakx closed 2 years ago

stakx commented 2 years ago

This follows in the footsteps of #573, where we introduced a standard IInvocation implementation type and re-used it for all methods of interface proxies without target. This present PR does the same for abstract methods of class proxies without target: those would always get a custom-built invocation type with identical InvokeMethodOnTarget implementations; so they, too, are eligible for invocation type reuse.

The tests cover all combinations of (a) abstract vs. virtual, (b) public vs. protected, and (c) generic vs. non-generic method: