Segfault when casting array of Interface types

rcor via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Sep 15 20:24:01 PDT 2014


seemingly even weirder:

   I[] i0 = [new C, new C];
   assert(cast(C) i0[0]);  // fine

   C[] c = [new C, new C];
   I[] i1 = cast(I[]) c;
   assert(cast(C) i1[0]);  // fails

It works when I create an I[] from a C[] literal, but not when I 
cast a previously declared C[] to an I[].


More information about the Digitalmars-d-learn mailing list