Bug fix: CompositionProxyTypeBuilder crashed when class has protected constructor.

This commit is contained in:
ohad
2013-02-08 13:04:25 +02:00
parent fc22f0253d
commit 2204ce8ea5
2 changed files with 15 additions and 2 deletions

View File

@@ -197,8 +197,8 @@ namespace Spring.Proxy
{
il.Emit(OpCodes.Ldarg_S, i);
}
il.Emit(OpCodes.Newobj, TargetType.GetConstructor(
ReflectionUtils.GetParameterTypes(constructor.GetParameters())));
il.Emit(OpCodes.Newobj, constructor);
il.Emit(OpCodes.Stfld, targetInstance);
}

View File

@@ -0,0 +1,13 @@
namespace Spring.Objects
{
public class ClassWithProtectedCtor : IOther
{
protected ClassWithProtectedCtor()
{
}
public void Absquatulate()
{
}
}
}