www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3487] New: [tdpl] Covariant returns needed for typedef

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

           Summary: [tdpl] Covariant returns needed for typedef
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: andrei metalanguage.com



10:20:03 PST ---
Consider:

struct A {
    A fun() { return A.init; }
}

typedef A B;

void main() {
    B b;
    B c = b.fun();
}

The return type of a member of A must be automatically cast to B when used
through a typedef. This is in order to allow B support the same methods as A.
It is also consistent with typedefs of built-in types.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 07 2009
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3487


Walter Bright <bugzilla digitalmars.com> changed:

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



10:54:33 PST ---
Dropping typedef, so won't fix.

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