[Issue 2056] New: Const system does not allow certain safe casts/conversions involving deep composite types

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 28 17:10:06 PDT 2008


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

           Summary: Const system does not allow certain safe
                    casts/conversions involving deep composite types
           Product: D
           Version: 2.013
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: brunodomedeiros+bugz at gmail.com


Const system does not allow certain safe casts/conversions involving deep
composite types. In the following example, all casts should be allowed.
----

void testcases()
{
        int[][] intArrayArray;
        int[][][] intArrayArrayArray;


        const(int)[][] f1 = intArrayArray; // Error here
        const(int[])[] f2 = intArrayArray; 

        const(int)[][][] g1 = intArrayArrayArray; // Error here
        const(int[])[][] g2 = intArrayArrayArray; // Error here
        const(int[][])[] g3 = intArrayArrayArray;

}


-- 



More information about the Digitalmars-d-bugs mailing list