[Issue 799] Array literal with covariant types

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jan 6 08:43:21 PST 2007


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


fvbommel at wxs.nl changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
           Keywords|                            |spec
         OS/Version|Linux                       |All
           Platform|Other                       |All




------- Comment #1 from fvbommel at wxs.nl  2007-01-06 10:43 -------
Array literals have type T[], where T is the type of the first element (except
when that's a static array, then it's the dynamic version IIRC).
Try this:

array=[cast(BaseClass)new Class1, new Class2];

That should work.

It'd be nice if the original code worked though, so I'm changing this to an
enhancement request.


-- 



More information about the Digitalmars-d-bugs mailing list