Summary: CTFE Internal error with -inline and associative
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD

--- Comment #0 from 2012-04-13 20:38:32 PDT ---
Reduced test case created with Dustmite and a bit of hand-editing:


import std.range;

class Trie(K, V)
    void add(K key, V val)
        Trie!(K,V) current = this;
        foreach(keyPart; key)
            current.children[keyPart] = new Trie!(K, V);
    Trie!(K,V)[ElementType!K] children;

string fun(string[] args ...)
    auto t = new Trie!(string, string);
    t.add(args[0], "");
    foreach(v; t.children)
        if (v.children.length) {}
    return "";

void main()
    mixin(fun("=", "TokenType.assign"));


testcase.d(21): Error: CTFE internal error: illegal value ��D.children

dmd: interpret.c:6678: void VarDeclaration::setValue(Expression*): Assertion
`isCtfeValueValid(newval)' failed.


No, that garbage in the error message is not a copy-paste error. It's different
each time I try to build, which leads me to suspect that something in the
compiler was uninitialized.

Possibly related: changing line 21 to foreach(v; t.children.values) results in
this error:

dmd: interpret.c:5527: TypeAArray* toBuiltinAAType(Type*): Assertion `t->ty ==
Tstruct' failed.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to