]>
Commit | Line | Data |
---|---|---|
b4c522fa IB |
1 | /* |
2 | TEST_OUTPUT: | |
3 | --- | |
68f46862 IB |
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 | |
b4c522fa IB |
8 | --- |
9 | */ | |
10 | ||
5fee5ec3 IB |
11 | // https://issues.dlang.org/show_bug.cgi?id=420 |
12 | // mixin make dmd break | |
b4c522fa IB |
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 | } |