]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gdc.test/fail_compilation/fail117.d
d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail117.d
CommitLineData
b4c522fa
IB
1/*
2TEST_OUTPUT:
3---
68f46862
IB
4fail_compilation/fail117.d(37): Error: expression `foo.mixin MGettor!(a) geta;
5` is `void` and has no value
6fail_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
15template MGettor(alias Fld)
16{
17 typeof(Fld) opCall()
18 {
19 //writefln("getter");
20 return Fld;
21 }
22}
23
24class Foo
25{
26 int a = 1,
27 b = 2;
28
29 mixin MGettor!(a) geta;
30 mixin MGettor!(b) getb;
31}
32
33void main()
34{
35 auto foo = new Foo;
36
37 int a = foo.geta;
38 int b = foo.getb;
39}