[Issue 6533] New: Compiler should catch duplicate overrides

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Aug 19 19:26:42 PDT 2011


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

           Summary: Compiler should catch duplicate overrides
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrej.mitrovich at gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2011-08-19 19:26:40 PDT ---
class Foo
{
    abstract void foo();
}

class Bar : Foo
{
    override void foo() 
    {
        // code
    }

    override void foo() { }
}

void main() {}

This ends up being a linker error such as:  Offset 00542H Record Type 00C3
 Error 1: Previous Definition Different : _D12overridetest3Bar3fooMFZv

The problem is in a large class you might end up mistakenly defining an
overriden function twice, and you won't get a compile-time error, you will get
a linker error instead.

Making this a compile-time error would be an improvement.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list