I want to call a generic method that constrains the input type T to implement two interfaces:
interface IA { }
interface IB { }
void foo(T t) where
Does the C# 4.0 dynamic keyword get you out of jail (mostly) free? After all - you are already doing the type checking.
interface IC : IA, IB { }
void bar(object obj)
{
if (obj is IA && obj is IB)
{
IC x = (dynamic)obj;
foo(x);
}
}
Does that break if foo tries to cast the parameter to T? I don't know.