-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Description
I'm not sure if this is expected behavior.
interface IDo
{
void Do();
}
sealed class DoNothing : IDo
{
void IDo.Do() { }
}class TheDoNothing
{
[Test]
public void CanActLike()
{
var instance = new DoNothing();
var acting = instance.ActLike<IDo>();
acting.Do(); // throws RuntimeBinderException
}
}I read about Dynamitey UsagePrivate but this produces the same result.
class TheDoNothing
{
[Test]
public void CanActLike()
{
var instance = new DoNothing();
var context = new InvokeContext(instance, typeof(IDo));
var acting = context.ActLike<IDo>();
acting.Do(); // throws RuntimeBinderException
}
}Obviously this a toy example, but I'm running into real issues when trying to do something similar using DynamicActLike() with an interface type known only at runtime.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels