www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2377] New: ICE with wrong return type for templated method: template.c:784

reply d-bugmail puremagic.com writes:

           Summary: ICE with wrong return type for templated method:
           Product: D
           Version: 2.019
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: dhasenan gmail.com

Error message:
dmd: template.c:784: MATCH
TemplateDeclaration::deduceFunctionTemplateMatch(Loc, Objects*, Expression*,
Expressions*, Objects*): Assertion `i < parameters->dim' failed.

Test case:
int call (TReturn) ()
    return "hello";

void main ()

Sep 27 2008
parent d-bugmail puremagic.com writes:

bugzilla digitalmars.com changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME

------- Comment #1 from bugzilla digitalmars.com  2008-10-02 19:05 -------
I get:

test5.d(4): Error: cannot implicitly convert expression ("hello") of type
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.

Oct 02 2008