Re: Method overrides and covariant return types

[email protected] Fri, 5 Mar 2004 05:12:03 -0600
Newsgroups gmane.comp.lang.nice.general
Message-ID <[email protected]>
Quoting Daniel Bonniot <[email protected]>:
> You cannot at the same time say that a situation is potentially 
> dangerous (and so report a warning) and that you still want to support 
> it, unless there is a way to mark in the code that you really mean that. 

I agree with that.

> Otherwise you have warnings that you know you can ignore, which will 
> eventually lead you to ignore warnings that are meaningful.
> 
> If both methods are defined in the same package, then you have the 
> freedom not to name then identically from the start. If one of them is 
> imported, then you can use a fully qualified name, which is indeed a way 
> to state "yes, i really want a new method declared here, not an override".

This was what I originally thought too, but I think the parser doesn't parse
this. At least I could not get it to work in my attempts earlier today. The
syntax would be this, right?:
   package i;
   class A { }
   void i.foo(A a) { }

The parser does not like the dot after "void f":
line 3, column 10:
   Encountered ".".
   Was expecting:
    "(" ...

- Brian





-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click