d: Merge upstream dmd, druntime 4c18eed967, phobos d945686a4.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail2450.d
blob82118d5de4526faf39a59762a83e014533c37304
1 // https://issues.dlang.org/show_bug.cgi?id=2450
2 /*
3 TEST_OUTPUT:
4 ---
5 fail_compilation/fail2450.d(22): Error: function expected before `()`, not `this.mixin Event!() clicked;
6 ` of type `void`
7 fail_compilation/fail2450.d(25): Error: function expected before `()`, not `b.mixin Event!() clicked;
8 ` of type `void`
9 ---
12 template Event()
14 void opCall() { }
15 void opAddAssign(int i) { }
17 class Button {
18 mixin Event clicked;
19 void func()
21 clicked.opCall(); // works
22 this.clicked(); // works
24 auto b = new Button();
25 b.clicked(); // works