[Issue 8593] New: CT out of bounds checks sometimes skipped

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 27 08:11:12 PDT 2012


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

           Summary: CT out of bounds checks sometimes skipped
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrej.mitrovich at gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2012-08-27 08:11:09 PDT ---
This compiles but it should give a CT error since x[4] is out of bounds:
import std.typetuple;
void main()
{
    alias TypeTuple!(int) x;
    static if (is(x[4] == int))
    {
    }
}

This correctly gives the error message, 'int' and 'x[4]' just swapped places:
import std.typetuple;
void main()
{
    alias TypeTuple!(int) x;
    static if (is(int == x[4]))
    {
    }
}

test.d(17): Error: tuple index 4 exceeds 1

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


More information about the Digitalmars-d-bugs mailing list