Thread overview
[Issue 8517] New: ICE: Internal error: toir.c 178
Aug 07, 2012
Michal Minich
[Issue 8517] ICE(toir.c 178) or stack overflow with recursive alias template
Nov 15, 2012
Don
Oct 04, 2013
Walter Bright
August 07, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8517

           Summary: ICE: Internal error: toir.c 178
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: ice
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: michal.minich@gmail.com


--- Comment #0 from Michal Minich <michal.minich@gmail.com> 2012-08-07 08:35:47 PDT ---
dmd 2.060

void x1 () { y!(a => a)(); }
void x2 () { y!(a => a)(); }
void y (alias f) () { y!(a => a)(); }

Comment out either x1 or x2 line and error disappears.

This bug might be a duplicate of
http://d.puremagic.com/issues/show_bug.cgi?id=8460
http://d.puremagic.com/issues/show_bug.cgi?id=8436
http://d.puremagic.com/issues/show_bug.cgi?id=7917
http://d.puremagic.com/issues/show_bug.cgi?id=6426
and maybe others

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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|D2                          |D1 & D2
            Summary|ICE(toir.c 178)             |ICE(toir.c 178) or stack
                   |                            |overflow with recursive
                   |                            |alias template


--- Comment #1 from Don <clugdbug@yahoo.com.au> 2012-11-14 23:53:57 PST ---
Actually y!() is the problem, the other bit is just instantiating y.
Also stack overflows on D1 and 2.057.
The reason is, that the FQN of the delegate includes the FQN of the template.
You can see this if you use .mangleof (uncomment the pragma).
Simplified test case:

void y (alias f) () {
    int delegate(int) qq;
//   pragma(msg, qq.mangleof);
    y!(qq)();
}

void x1() { int q;    y!(q)(); }

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 04, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=8517


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |WORKSFORME


--- Comment #2 from Walter Bright <bugzilla@digitalmars.com> 2013-10-03 18:03:52 PDT ---
With 2.064 head:

Michal's example:

test.d(1): Error: template instance test.x1.y!((a) => a) recursive expansion

Don's example:

test.d(7): Error: template instance test.x1.y!(q) recursive expansion

Works on D1 1.077 too.

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