[Issue 1202] New: Dollar inside array literal inside index brackets is valid.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Apr 29 14:15:01 PDT 2007


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

           Summary: Dollar inside array literal inside index brackets is
                    valid.
           Product: D
           Version: 1.014
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: trivial
          Priority: P4
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: aziz.kerim at gmail.com


// writefln([1,2,$]); // '$' is valid only inside [] of index or slice
writefln([1,2,3][0 .. [$][0]]); // [1,2,3]
writefln([1,2,3][0 .. [0,$][1]]); // [1,2,3]
writefln([1,2,3][0 .. [0,1,$][$-1]]); // [1,2,3]
writefln([1,2,3][0 .. [0,1,$][$-$]]); // []
writefln([1,2,3][0 .. [$][$-$]]); // [1,2,3]
writefln([1,2,3][0 .. $*[$][0]/$]); // [1,2,3]
writefln([1,2,3][0 .. [$,[$][0]][0..$][0]]); // [1,2,3]


-- 



More information about the Digitalmars-d-bugs mailing list