1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail117.d(37): Error: expression `foo.mixin MGettor!(a) geta;
5 ` is `void` and has no value
6 fail_compilation/fail117.d(38): Error: expression `foo.mixin MGettor!(b) getb;
7 ` is `void` and has no value
8 ---
9 */
10 
11 // Issue 420 - mixin make dmd break
12 
13 //import std.stdio;
14 
15 template MGettor(alias Fld)
16 {
17     typeof(Fld) opCall()
18     {
19         //writefln("getter");
20         return Fld;
21     }
22 }
23 
24 class Foo
25 {
26     int a = 1,
27         b = 2;
28 
29     mixin MGettor!(a) geta;
30     mixin MGettor!(b) getb;
31 }
32 
33 void main()
34 {
35     auto foo = new Foo;
36 
37     int a = foo.geta;
38     int b = foo.getb;
39 }
40