File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
src/Castle.Core.Tests/DynamicProxy.Tests Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,17 @@ public virtual void MyMethodWithStruct(ref MyStruct s)
9292 }
9393 }
9494
95+ public class Factory
96+ {
97+ public virtual void Create < T > ( out T result ) => result = default ( T ) ;
98+ }
99+
100+ public class DerivedFactory : Factory
101+ {
102+ public override void Create < T > ( out T result ) => result = default ( T ) ;
103+
104+ }
105+
95106 [ Test ]
96107 public void CanAffectValueOfOutParameter ( )
97108 {
@@ -353,5 +364,13 @@ public void Exception_during_method_out_ref_arguments_set_interface_proxy_with_t
353364 Assert . AreEqual ( 23 , param1 ) ;
354365 Assert . AreEqual ( "23" , param2 ) ;
355366 }
367+
368+ [ Test ]
369+ public void Can_query_MethodInvocationTarget_for_overridden_class_method_having_a_generic_by_ref_parameter ( )
370+ {
371+ var interceptor = new WithCallbackInterceptor ( invocation => _ = invocation . MethodInvocationTarget ) ;
372+ var proxy = generator . CreateClassProxy < DerivedFactory > ( interceptor ) ;
373+ proxy . Create < object > ( out _ ) ;
374+ }
356375 }
357- }
376+ }
You can’t perform that action at this time.
0 commit comments