www.digitalmars.com         C & C++   DMDScript  

D.gnu - ICE with custom map template.

reply Elronnd <elronnd em.slashem.me> writes:
I get an ICE with the following code:


void main() {
         import std.stdio;

         template mmap(alias fun) {
                 void mmap(T...)(T list) {
                         foreach (item; list) {
                                 fun(item);
                         }
                 }
         }


         void printstuffs(T...)(T args) {
                 void printer(G)(G arg) {
                         writeln(arg);
                 }

                 mmap!printer(args);
         }


         printstuffs("bla", 7, 9.0);
}


The message printed is:

test.d: In function ‘mmap’:
test.d:7:8: internal compiler error: in get_frame_for_symbol, at 
d/d-codegen.cc:2208
      fun(item);
         ^
Sep 17 2017
parent Elronnd <elronnd em.slashem.me> writes:
See also the bugzilla 
(https://issues.dlang.org/show_bug.cgi?id=17836).
Sep 17 2017