Why does the compiler let this expression to compile while the run-time exception is inevitable?
I don't think that the Dynamic Binding
should work for void methods
static void Main(string[] args)
{
var res = Test((dynamic)"test"); // throws RuntimeBinderException exception at runtime
}
static void Test(dynamic args)
{
}
If the C# spec is referring the above expression as dynamically bound expression why doesn't the following method compile?
static dynamic DynamicMethod()
{
}