The following (invalid) code produces an ICE:
void foo(T...)() {
return "";
}
void main() {
foo!(int, char)();
}
dmd: template.c:4017: Identifier* TemplateInstance::genIdent(): Assertion `0' failed.
The 'return "";' is invalid code, because it's inside a function with void as return type. (That's a recent change to dmd.) Apparently, instead of printing a proper error message, something goes wrong.
Interestingly, the example above works when you change it to 'foo!(int)();', and dmd will print what looks like a proper error message.
Comment #1 by clugdbug — 2009-11-06T23:35:18Z
This is a regression between 1.036 and 1.041. It's nothing to do with return values: any error inside a tuple template will do it:
void foo(T...)() {
bug;
}
void main() {
foo!(int, char)();
}
On DMD1.041, this produced:
Assertion failure: 'i < parameters->dim' on line 796 in file 'template.c'
Comment #2 by robert — 2009-11-07T07:54:22Z
I believe this is a duplicate of bugzilla #1144.
*** This issue has been marked as a duplicate of issue 1144 ***
Comment #3 by nfxjfg — 2009-11-07T21:29:41Z
What? issue 1144 is marked as fixed, but this bug is triggered in the newest release, even if this is just the symptom of another known bug as Don said.
Comment #4 by clugdbug — 2009-11-07T22:43:31Z
*** This issue has been marked as a duplicate of issue 2229 ***