Array type inference

Jonathan M Davis jmdavisProg at gmx.com
Thu May 3 23:43:21 PDT 2012


On Friday, May 04, 2012 08:33:32 James Miller wrote:
> I am using an array of objects, all of which have a common type
> (They are all sub classes of Field). If I declare an array of
> these objects, D seems to try to cast them all to the last type
> in the array, rather than picking a common supertype. This
> happens even if I specify a type for the array, D still doesn't
> cast the types properly.
> 
> In the error message it also seems that it casts _some_ types
> properly, but others not, resulting in some very strange error
> messages. I can work around this by casting all of the elements
> to the common supertype, but this is not ideal.
> 
> Is this a known bug, expected functionality, or should I file a
> bug request?

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

- Jonathan M Davis


More information about the Digitalmars-d mailing list