Community
Participate
Working Groups
Let's assume we have Java class Base that is extended by X,Y and Z. We also have Xtend class: class Dispatch { foo(Z z){ f(z) //This will throw exception } dispatch f(X x){ 1 } dispatch f(Y y){ 2 } } Because dispatch leads to f(Base) Java function, f(Z) is a correct Java invocations, but we know this is incorrect invocations as user only created implementations for f(X) and f(Y). So I think it should be marked as error.
The runtime exception is intentional. Dispatching is an implementation detail and the caller doesn't know (and shouldn't) about it. You cannot tell at compile time what kind of dispatch functions are there since one for 'Z' could have been introduced in a subclass.
In old Xtend it was marked as error, but old Xtend does not have inheritance. The class can have a subclass, but can also be instantiated and such instance will lead to errors. If one plan to add such method in subclasses then 'abstract' method should be provided in this class, so we cannot create wrong instances and users know that subclasses should provide this behavior. IMO there should be at least a warning.
Closing all bugs that were set to RESOLVED before Neon.0