ICE with custom map template.

Elronnd elronnd at em.slashem.me
Sun Sep 17 22:08:28 UTC 2017


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);
         ^



More information about the D.gnu mailing list