import std.algorithm: count; import std.range: iota; void main() { int[] foo(R)(R m) { count!((a){ return true; })(m); return []; } foo(foo(iota(1))); } DMD 2.048 returns: Internal error: toir.c 190
I got the same ICE (dmd 2.048 on linux) and was able to reduce the problem to a small test case which does not involve any libraries like std.algorithm: struct A( alias P ) { static void a() { void aa() { P(); } } } template B( alias P ) { void b() { A!P a; } } struct C( alias P ) { void c() { B!P.b(); } } void main() { void bar() {} C!bar c; } Compiling this produces the same error: Internal error: toir.c 190
*** This issue has been marked as a duplicate of issue 4504 ***