|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.ide digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript electronics |
digitalmars.D.bugs - [Issue 2036] New: Hiding rules too restrictive
http://d.puremagic.com/issues/show_bug.cgi?id=2036 Summary: Hiding rules too restrictive Product: D Version: unspecified Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: andrei metalanguage.com Consider: class Base { void foo() {} void foo(int) {} } 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. -- Apr 25 2008
On 25/04/2008, d-bugmail puremagic.com <d-bugmail puremagic.com> wrote: Apr 25 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2036 ------- Comment #2 from andrei metalanguage.com 2008-04-26 01:48 ------- (In reply to comment #1)On 25/04/2008, d-bugmail puremagic.com <d-bugmail puremagic.com> wrote: Apr 25 2008
On 26/04/2008, d-bugmail puremagic.com <d-bugmail puremagic.com> wrote:On what grounds are you saying it's a valid warning? Apr 26 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2036 ------- Comment #4 from andrei metalanguage.com 2008-04-26 02:13 ------- (In reply to comment #3)On 26/04/2008, d-bugmail puremagic.com <d-bugmail puremagic.com> wrote:On what grounds are you saying it's a valid warning? Apr 26 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2036 ------- Comment #5 from wbaxter gmail.com 2008-04-26 02:23 ------- ((In reply to comment #3)so I refute the claim the warning is valid. Apr 26 2008
On 26/04/2008, d-bugmail puremagic.com <d-bugmail puremagic.com> wrote:What I meant to say was that if you want to sustain your claim, you have the burden of proof. Apr 26 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2036 ------- Comment #7 from kamm-removethis incasoftware.de 2008-04-26 04:35 ------- I think the rationale for the warning is the last case described in http://www.digitalmars.com/d/2.0/hijack.html Calling the hidden method of Derived via its vtbl did throw an exception for quite a while, but was recently changed to a compile-time warning. I don't think it's sensible for this particular case though, since the addition of foo() can hardly hijack a preexisting call to foo(int). -- Apr 26 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2036 ------- Comment #8 from brunodomedeiros+bugz gmail.com 2008-04-26 13:21 ------- So, whenever a function of an overload set is overriden, the language shouldn't require all functions of the overload set to be overriden, but only those with the same number of parameters (which are the ones susceptible of being called errounesly)? (and those with default parameters values too) -- Apr 26 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2036 ------- Comment #9 from andrei metalanguage.com 2008-04-26 14:51 ------- (In reply to comment #8)So, whenever a function of an overload set is overriden, the language shouldn't require all functions of the overload set to be overriden, but only those with the same number of parameters (which are the ones susceptible of being called errounesly)? (and those with default parameters values too) Apr 26 2008
|