Summary: Class method hidden by another one warning
           Product: D
           Version: future
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from 2010-05-20 16:55:27 PDT ---
This D2 program:

class A {
  void foo(A a) {}
class B : A { // line 4
  void foo(B b) {}
void main() {}

It compiles with no problems with dmd v2.046:
dmd test.d

But if I compile it with:
dmd -w test.d

I receive a compile error:
test.d(4): Error: class test.B a) is hidden by B

In my opinion that error message can be improved in something like this (that
also informs the programmer that this error comes from the -w switch):

test.d(4): Warning: class method a) is hidden by b)

I presume this warning is useful because it can avoid bugs. If it is important
it can become a true error, that doesn't need -w to show up (see also bug 3836

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to