On Sun, 17 Oct 2010 04:17:18 +0400, Andrei Alexandrescu
<[email protected]> wrote:
On 10/16/2010 05:57 PM, kenji hara wrote:
Current dmd does not enough support runtime reflection.
[snip]
I think runtime reflection is not needed. What you'd need to do for the
"loose duck" is generate code that throws for all interface methods that
are not present in the class. Am I wrong?
Andrei
interface ICanQuack
{
void quack() { ... }
}
class Duck
{
void quack() { .. }
}
Object o = new Duck();
Duck d = duck!(ICanQuack)(o);
d.quack(); // throw or not?