Community
Participate
Working Groups
I'm only reporting this because covariant return type support was reported for the I20040727 build... I apologize if this is a known issue (I couldn't find a bug report for it...) This is not allowed, although it should be (afaik): public ListWriter extends Writer { ... public void append(char ch) { ... ... } The error reported is "The return type is incompatible with Writer.append(char)." Eclipse I20040824 GTK
I've misunderstood some of the fundamentals of covariant return types. If there is an issue, it might be the nature of the error message (it lead me to believe that what I was doing was ok, when, afaik, void can not be a specialization of anything). Modifying summary to reflect.
The purpose of the error message is let you know that you're overriding an inherited method in an incompatible way. It seems obvious to me, but maybe you could suggest something different?
Would "'void' is not a valid covariant type." be too lame?
I'm not convinced we need to make a special case out of 'void'. Plus we don't want to lose the fact that you're overriding an inherited method.
I think we will leave the error message as is.