[Issue 1992] New: Incorrect out-of-bounds error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Apr 13 17:17:35 PDT 2008


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

           Summary: Incorrect out-of-bounds error
           Product: D
           Version: 2.012
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: bartosz at relisoft.com


In the following program, dmd issues the error:
test.d(7): Error: array index 0 is out of bounds [][0 .. 0]

string foo (string [] list, string s)
{
        if (list.length == 0)
                return "int x; ";
        else
        {
                return foo (list [1..$], list [0]);
        }
}

mixin (foo (["a", "b"], ""));


-- 



More information about the Digitalmars-d-bugs mailing list