digitalmars.D.bugs - [Issue 9978] New: Can override interface function
- d-bugmail puremagic.com (28/28) Apr 22 2013 http://d.puremagic.com/issues/show_bug.cgi?id=9978
- d-bugmail puremagic.com (12/12) Apr 22 2013 http://d.puremagic.com/issues/show_bug.cgi?id=9978
- d-bugmail puremagic.com (10/21) Apr 22 2013 http://d.puremagic.com/issues/show_bug.cgi?id=9978
http://d.puremagic.com/issues/show_bug.cgi?id=9978 Summary: Can override interface function Product: D Version: D1 & D2 Platform: All OS/Version: All Status: NEW Severity: minor Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: damianday hotmail.co.uk interface I { void foo(); } class A : I { public override void foo() { } // OK, but should be NG!! public void foo() { } // OK } In this example the use of override is optional, however since we are not overriding any function it should be illegal to specify it as override. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 22 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9978 10:22:51 PDT --- I would tend to think this is allowed. Imagine if you switched an interface to an abstract base class or vice versa, you wish to make someone go through all their calls and add/remove override? I had a bug fixed a long time ago, issue 2524. In a comment, Walter said: "This is a compiler bug. You can override an interface function." I'm assuming this still applies today. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 22 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9978I would tend to think this is allowed. Imagine if you switched an interface to an abstract base class or vice versa, you wish to make someone go through all their calls and add/remove override? I had a bug fixed a long time ago, issue 2524. In a comment, Walter said: "This is a compiler bug. You can override an interface function." I'm assuming this still applies today.That's precisely what I was doing when I stumbled upon this, changing a abstract class to a interface. I'm not sure why both are allowed, even though it does no harm to keep both, it seems one should be the right way and the other a warning possibly? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 22 2013