www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1992] New: Incorrect out-of-bounds error

reply d-bugmail puremagic.com writes:
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 digitalmars.com
        ReportedBy: bartosz 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"], ""));


-- 
Apr 13 2008
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1992


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies gmail.com
         Resolution|                            |FIXED


--- Comment #1 from yebblies <yebblies gmail.com> 2011-06-10 02:32:10 PDT ---
This compiles without error now. (dmd2.053)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 10 2011