Summary: Subtyping with "alias this" doesn't mix with regular
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Max Samukha <> 2010-12-27 03:59:11 
PST ---
class A

class B
    A a;
    alias a this;

class C : B

void main()
    A a = new C; // error

Error: cannot implicitly convert expression (new C) of type test.C to test.A

Since C is a subtype of B (via inheritance) and B is a subtype of A (via "alias
this"), C should be implicitly convertible to A.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to