www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10195] New: auto type inference on method override

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10195

           Summary: auto type inference on method override
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: SebastianGraf t-online.de



13:58:15 PDT ---
Overload resolution fails to recognize baz in the following example to be a
valid candidate for an override:

interface Foo {
    int baz();
}

class Bar : Foo {
    auto baz() { return cast(int)1; }
}

pragma(msg, typeof(Foo.baz).stringof); // int()
pragma(msg, typeof(Bar.baz).stringof); // int()

main.d(8): Error: function foo.Bar.baz of type () overrides but is not
covariant with foo.Foo.baz of type int()

It seems like auto isn't resolved before the covariance check.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 28 2013
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10195


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andrej.mitrovich gmail.com
         Resolution|                            |DUPLICATE



13:59:32 PDT ---
*** This issue has been marked as a duplicate of issue 8318 ***

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