Bug 2377 – ICE with wrong return type for templated method: template.c:784
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2008-09-27T09:37:00Z
Last change time
2015-06-09T01:20:16Z
Keywords
ice-on-invalid-code
Assigned to
bugzilla
Creator
dhasenan
Comments
Comment #0 by dhasenan — 2008-09-27T09:37:14Z
Error message:
dmd: template.c:784: MATCH TemplateDeclaration::deduceFunctionTemplateMatch(Loc, Objects*, Expression*, Expressions*, Objects*): Assertion `i < parameters->dim' failed.
Aborted
Test case:
---
int call (TReturn) ()
{
return "hello";
}
void main ()
{
call!(void)();
}
---
Comment #1 by bugzilla — 2008-10-02T19:05:59Z
I get:
test5.d(4): Error: cannot implicitly convert expression ("hello") of type invari
ant(char[5u]) to int
test5.d(9): template instance test5.call!(void) error instantiating
which is correct. I cannot duplicate the problem. Works correctly with D 1 too.