[Issue 4379] DMD chokes on large nested loop over tuple.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jun 23 19:57:25 PDT 2010


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



--- Comment #1 from David Simcha <dsimcha at yahoo.com> 2010-06-23 19:57:24 PDT ---
Actually, this appears to be related to the total size of the loop body being
generated at compile time.  Nesting has nothing to do with it.  The cutoff
appears to be (of all numbers) 198 elements.

import std.stdio, std.typetuple;

// CTFE function to generate a huge tuple.
string generateHugeTuple() {
    string ret = "alias TypeTuple!(";

    foreach(outer; 0..198) {
        ret ~= '1';
        ret ~= ',';
    }

    ret = ret[0..$ - 1];  // Drop last ,
    ret ~= ") LetterTuple;";
    return ret;
}

mixin(generateHugeTuple());

void main() {
    foreach(letter; LetterTuple) {
        writeln(letter);
    }
}

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