January 05, 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@puremagic.com
        ReportedBy: repeatedly@gmail.com


--- Comment #0 from Masahiro Nakagawa <repeatedly@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: -------
February 13, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3676


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |WORKSFORME


--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> 2010-02-12 23:03:43 PST ---
The first example compiles correctly with dmd 2.041.

The second example correctly fails, because shared cannot override an unshared method.

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