[Issue 2036] Hiding rules too restrictive

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 25 23:48:35 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2036





------- Comment #2 from andrei at metalanguage.com  2008-04-26 01:48 -------
(In reply to comment #1)
> On 25/04/2008, d-bugmail at puremagic.com <d-bugmail at puremagic.com> wrote:
> >  class Derived : Base
> >  {
> >     override void foo(int) {}
> >  }
> >
> >  When -w is enabled, the compiler complains that Derived.foo hides Base.foo. In
> >  effect, the overriding function properly overrides the second foo in Base but
> >  also hides the first foo.
> >
> >  Probably more permissiveness would be helpful in such cases.
> 
> I disagree. It's a valid warning. 

On what grounds are you saying it's a valid warning? The spirit of the
limitation is to prevent code that shouldn't compile from compiling and running
with surprising effects. In this case there are no surprising effects if the
code does compile, so I refute the claim the warning is valid.

Andrei


-- 



More information about the Digitalmars-d-bugs mailing list