Bug 2723 – ICE with variadic template parameters, different case
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2009-03-10T09:24:00Z
Last change time
2015-06-09T05:15:20Z
Keywords
ice-on-invalid-code
Assigned to
bugzilla
Creator
andrei
Comments
Comment #0 by andrei — 2009-03-10T09:24:10Z
Related to 2722:
//import std.typecons;
Tuple!(Types)[] foo(Types...)(string a)
{
Tuple!(Types)[] result;
return result;
}
void main()
{
auto a = foo!(int, double)("s");
}
fails with:
dmd: template.c:798: MATCH TemplateDeclaration::deduceFunctionTemplateMatch(Loc, Objects*, Expression*, Expressions*, Objects*): Assertion `i < parameters->dim' failed.
What happened is that the identifier "Tuple" is not known. The compiler should clarify that in the error message. Uncommenting the import line makes the code work.
Comment #1 by dhasenan — 2009-03-10T21:35:03Z
I have a similar case that fails with the same assertion in 1.041. In 1.039, it segfaulted instead.