Thread overview
[Issue 3482] New: dmd: template.c:4017: Identifier* TemplateInstance::genIdent(): Assertion `0' failed.
Nov 07, 2009
nfxjfg@gmail.com
[Issue 3482] ICE(template.c:4017): instantiating invalid tuple template. D1 only.
Nov 07, 2009
Don
Nov 07, 2009
Robert Clipsham
Nov 08, 2009
nfxjfg@gmail.com
Nov 08, 2009
Don
November 07, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3482

           Summary: dmd: template.c:4017: Identifier*
                    TemplateInstance::genIdent(): Assertion `0' failed.
           Product: D
           Version: 1.051
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: nfxjfg@gmail.com


--- Comment #0 from nfxjfg@gmail.com 2009-11-06 16:17:39 PST ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 07, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3482


Don <clugdbug@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug@yahoo.com.au
            Summary|ICE(template.c:4017):       |ICE(template.c:4017):
                   |Identifier*                 |instantiating invalid tuple
                   |TemplateInstance::genIdent( |template. D1 only.
                   |): Assertion `0' failed.    |
           Severity|normal                      |regression


--- Comment #1 from Don <clugdbug@yahoo.com.au> 2009-11-06 23:35:18 PST ---
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'

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 07, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3482


Robert Clipsham <robert@octarineparrot.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |robert@octarineparrot.com
         Resolution|                            |DUPLICATE


--- Comment #2 from Robert Clipsham <robert@octarineparrot.com> 2009-11-07 07:54:22 PST ---
I believe this is a duplicate of bugzilla #1144.

*** This issue has been marked as a duplicate of issue 1144 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 08, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3482



--- Comment #3 from nfxjfg@gmail.com 2009-11-07 21:29:41 PST ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 08, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3482



--- Comment #4 from Don <clugdbug@yahoo.com.au> 2009-11-07 22:43:31 PST ---
*** This issue has been marked as a duplicate of issue 2229 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------