[Issue 3676] New: shared function override

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 5 06:26:09 PST 2010


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

           Summary: shared function override
           Product: D
           Version: 2.038
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: repeatedly at gmail.com


--- Comment #0 from Masahiro Nakagawa <repeatedly at gmail.com> 2010-01-05 06:26:07 PST ---
class Sample
{
    void method() {}
    shared void method() {}
}

class Sample2 : Sample
{
    override void method() {}
    override shared void method() {} // Line 10
}

2.037 succeeds in compiling this code, but 2.038 and 2.039 fail.
2.039 outputs following error message:

 foo.d(10): Error: function foo.Sample2.method of type shared void()
 overrides but is not covariant with foo.Sample2.method of type void()

For that matter, following code is minimum sample which same error occurs.

class Sample
{
    void method() {}
}

class Sample2 : Sample
{
    shared void method() {}
}

-- 
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