// this happens on Windows XP, 32bit, any version between dmd2-042 and dmd2-055 // there was also a feedback that linux dmd2-055 causes segfault // workaround for this is to use -O when compiling (both or windows and linux) import std.stdio; mixin template tpl1 (alias fn) { void b () { // calling fn causes Access Violation if there is two or more int declarations // in order to make this work either remove one int declaration or remove fn call int c; int d; fn(); } } class a { mixin tpl1!(function () { writeln("test"); }); } void main () { a a1 = new a(); a1.b(); }
Also fails with 2.059 Win32
*** This issue has been marked as a duplicate of issue 11545 ***