covariant return types means usually to have two method withe the same name and the same parameter types, but diefferent return types. Groovy does support this already:
class A{
void foo(){}
Object foo(){}
}
A.class.declaredMethods.each{println it}
and you get:
public void A.setProperty(java.lang.String,java.lang.Object)
public java.lang.Object A.getProperty(java.lang.String)
public java.lang.Object A.invokeMethod(java.lang.String,java.lang.Object)
public groovy.lang.MetaClass A.getMetaClass()
public void A.setMetaClass(groovy.lang.MetaClass)
static java.lang.Class A.class$(java.lang.String)
public void A.foo()
public java.lang.Object A.foo()
there are 2 foo methods, so the methods are there. To do it like java means to let one of it redirect to the other automatically. This part is missing, yes.
btw, you can only call only one of these methods!
covariant return types means usually to have two method withe the same name and the same parameter types, but diefferent return types. Groovy does support this already:
class A{
void foo(){}
Object foo(){}
}
A.class.declaredMethods.each{println it}
and you get:
public void A.setProperty(java.lang.String,java.lang.Object)
public java.lang.Object A.getProperty(java.lang.String)
public java.lang.Object A.invokeMethod(java.lang.String,java.lang.Object)
public groovy.lang.MetaClass A.getMetaClass()
public void A.setMetaClass(groovy.lang.MetaClass)
static java.lang.Class A.class$(java.lang.String)
public void A.foo()
public java.lang.Object A.foo()
there are 2 foo methods, so the methods are there. To do it like java means to let one of it redirect to the other automatically. This part is missing, yes.
btw, you can only call only one of these methods!