View mode: basic / threaded / horizontal-split · Log in · Help
April 01, 2012
[Issue 7807] New: Ambiguous virtual function error on const overloading with covariant return types
http://d.puremagic.com/issues/show_bug.cgi?id=7807

          Summary: Ambiguous virtual function error on const overloading
                   with covariant return types
          Product: D
          Version: D2
         Platform: x86_64
       OS/Version: Windows
           Status: NEW
         Severity: normal
         Priority: P2
        Component: DMD
       AssignedTo: nobody@puremagic.com
       ReportedBy: rbixby@hotmail.com


--- Comment #0 from Read Bixby <rbixby@hotmail.com> 2012-04-01 13:55:17 PDT ---
The following code produces the error:  "Error: class Implementation ambiguous
virtual function getNext"

interface Interface
{
   Interface getNext();
   const(Interface) getNext() const;
}

class Implementation : Interface
{
   Implementation getNext()
   {
       return null;
   }

   const(Implementation) getNext() const
   {
       return null;
   }
}

The error does not appear if "Interface" is changed to an abstract class.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 27, 2012
[Issue 7807] Ambiguous virtual function error on const overloading with covariant return types
http://d.puremagic.com/issues/show_bug.cgi?id=7807



--- Comment #2 from github-bugzilla@puremagic.com 2012-04-27 10:47:55 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/fecb72a7f64e346c27e082bf89efde83ff9ddf5b
fix Issue 7807 - Ambiguous virtual function error on const overloading with
covariant return types

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 27, 2012
[Issue 7807] Ambiguous virtual function error on const overloading with covariant return types
http://d.puremagic.com/issues/show_bug.cgi?id=7807


Walter Bright <bugzilla@digitalmars.com> changed:

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


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Top | Discussion index | About this forum | D home