1 // REQUIRED_ARGS: 2 3 /**********************************/ 4 // https://issues.dlang.org/show_bug.cgi?id=19479 5 genInts19479a()6mixin template genInts19479a() 7 { 8 static foreach (t; 0..1) 9 int i = 5; 10 } 11 genInts19479b()12mixin template genInts19479b() 13 { 14 static foreach (t; 0..2) 15 mixin("int i" ~ cast(char)('0' + t) ~ " = 5;"); 16 } 17 test19479()18void test19479() 19 { 20 { 21 static foreach (t; 0..1) 22 int i = 5; 23 assert(i == 5); 24 } 25 { 26 mixin genInts19479a!(); 27 assert(i == 5); 28 } 29 { 30 static foreach (t; 0..2) 31 mixin("int i" ~ cast(char)('0' + t) ~ " = 5;"); 32 assert(i0 == 5); 33 assert(i1 == 5); 34 } 35 { 36 mixin genInts19479b!(); 37 assert(i0 == 5); 38 assert(i1 == 5); 39 } 40 } 41 main()42void main() 43 { 44 test19479(); 45 } 46