http://d.puremagic.com/issues/show_bug.cgi?id=6028

           Summary: Cannot implicitly convert an array of class to an
                    array of interface
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: kenn...@gmail.com


--- Comment #0 from kenn...@gmail.com 2011-05-18 09:12:23 PDT ---
Test case:

----------------------------
interface X {}
class K : X {}
class L : K {}

void main() {
    L[] x;
    K[] y = x;  // ok
    X[] z = y;  // error
} 
----------------------------
test.d(8): Error: cannot implicitly convert expression (y) of type K[] to X[]
----------------------------

It should be possible to implicitly convert an array of class to an array of
(one of) its base interface type.

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

Reply via email to