DMD 2.041 and 2.042 on Mac OS X crash with this input. It was working a few versions before, but I don't know exactly at which point it broke. import std.variant; struct A {} alias Algebraic!(A) sts;
Reduced test case shows it's a regression from AAs becoming a library type. template ICE3996(T : V[K], K, V) {} struct Bug3996 {} static assert(!is( ICE3996!(Bug3996) ));
I think the root cause of this is bug 4269.
*** Issue 4449 has been marked as a duplicate of this issue. ***
This turns out to be simple. When there's an error in the AA parameters, it should not continue to instantiate the template. There's no "error declaration", so return a struct of type TError. Not sure if it's OK to give it no name. (Would also be possible to return NULL in this case, but then everything that calls it would need to be changed, to prevent segfaults). PATCH(mtype.c): Line 3966 StructDeclaration *TypeAArray::getImpl() { // Do it lazily if (!impl) { Type *index = this->index; Type *next = this->next; if (index->reliesOnTident() || next->reliesOnTident()) { error(loc, "cannot create associative array %s", toChars()); index = terror; next = terror; + StructDeclaration *s = new StructDeclaration(0, NULL); + s->type = terror; + return s; }
http://www.dsource.org/projects/dmd/changeset/672