[Issue 7318] Cannot concatenate arrays of super- and subtype

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jan 19 02:36:36 PST 2012


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


timon.gehr at gmx.ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |


--- Comment #2 from timon.gehr at gmx.ch 2012-01-19 02:36:35 PST ---
It is valid. Exception implicitly converts to Object. Since the resulting array
from the concatenation is unique, there is no chance mutable aliasing occurs
(which is the only reason covariant arrays are unsound in general).

To further back up my point, this compiles, and it is not a bug:

void main(){
    auto a = [new Object()];
    auto b = [new Exception("")];
    a~=b;
}

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


More information about the Digitalmars-d-bugs mailing list