Summary: [tdpl] Covariant returns needed for typedef
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Andrei Alexandrescu <> 2009-11-07 
10:20:03 PST ---

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

typedef A B;

void main() {
    B b;
    B c =;

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:
------- You are receiving this mail because: -------

Reply via email to