lexicalscope/eventcast — pull request #3 by neuronotic (2012-02-18 21:23:26+00:00)
Title: I think I fixed it?

Hope that does it. I played around with ways to do it (different commits) and this seemed the most readable / reasonable of the 2.

as an aside:

I didn't realise that when you have
interface A {}
interface B {}
interface C extends A, B {}
class D implements C {}
class E extends D {}
Object o = new E();

that you could have multiple inheretence in interfaces. Is this the correct way to think about it? Like I read that "interfaces are not part of the class hierarchy". So is it for the same reason that a class can implement many interfaces that an interface can extend many interfaces?

I got into this because originally, using a simplified scenario of the above, where there's no interface B (eg interface C extends A{} since I didn't know you could do that), I was trying to get the class representing interface A , starting from class representing class E. I thought I'd have to :

o.getSuperClass().getInterfaces()[0].getSuperClass();
but that returned null

But it took me a while to figure out that no, I need to do But figured that requires traversing the whole tree rather than
o.getSuperClass().getInterfaces()[0].getInterfaces()[0]
E D C A

But I'm not sure it's clear in a way I'm happy with, with regards to the motivation for allowing interfaces to extend multiple interfaces and why conceptually the interface has interfaces rather than superclasses?