]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/runnable/test711.d
d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / runnable / test711.d
1 // https://issues.dlang.org/show_bug.cgi?id=711
2 string result;
3
4 template Mixer()
5 {
6 override void test()
7 {
8 result ~= "A";
9 }
10 }
11
12 class Foo
13 {
14 void test()
15 {
16 result ~= "B";
17 }
18 }
19
20 class Bar : Foo
21 {
22 mixin Mixer!() mixer;
23 override void test()
24 {
25 result ~= "C";
26 mixer.test();
27 }
28 }
29
30 class Bar2 : Foo
31 {
32 override void test()
33 {
34 result ~= "C";
35 mixer.test();
36 }
37 mixin Mixer!() mixer;
38 }
39
40 void main()
41 {
42 Bar f = new Bar();
43 f.test();
44 assert(result == "CA");
45
46 result = "";
47
48 Bar2 f2 = new Bar2();
49 f2.test();
50 assert(result == "CA");
51 }