[Issue 8577] New: static assert is triggered after tuple bounds check

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 21 13:17:09 PDT 2012


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

           Summary: static assert is triggered after tuple bounds check
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: ellery-newcomer at utulsa.edu


--- Comment #0 from Ellery Newcomer <ellery-newcomer at utulsa.edu> 2012-08-21 13:17:04 PDT ---
I find it very annoying that the following code results in a tuple out of
bounds error message and not only the static assert message.

template T(Ts...) {
    static assert(Ts.length > 1);
    alias Ts[1] Z;
}

void main() {
    alias T!(int).Z Z2;
}

gives

wiz.d(4): Error: tuple index 1 exceeds 1
wiz.d(3): Error: static assert  (1LU > 1LU) is false
wiz.d(8):        instantiated from here: T!(int)

I think error reporting should stop at the static assert.

-- 
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