www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2325] New: using alias template parameter with anonymous delegate before passing it on crashes compiler

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2325

           Summary: using alias template parameter with anonymous delegate
                    before passing it on crashes compiler
           Product: D
           Version: 1.026
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: fawzi gmx.ch


the following code fails to compile

{{{
int f(alias g)(int x){
    return g(x);
}

int h(alias g)(int x){
    int y=x;
    y=g(x); // this line makes the compiler crash
    return f!(g)(y);
}

void main(){
    int y,z;
    y=h!((int x){return 2*x;})(z); // fails only with inline delegate
}
}}}


-- 
Sep 01 2008
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2325






I got to this error trying to reduce an error that made the compiler stop with
the following message
"template instance inconsistent nesting levels for h and f"


-- 
Sep 01 2008
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2325






DMD1.042 and 2.029 display:
Internal error: toir.c 183


-- 
Apr 21 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2325


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug yahoo.com.au
            Summary|using alias template        |ICE(toir.c) using alias
                   |parameter with anonymous    |template parameter with
                   |delegate before passing it  |anonymous delegate before
                   |on crashes compiler         |passing it on





No longer ICEs in DMD2.030. Still ICE in 1.045.

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