mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
27 lines
561 B
D
27 lines
561 B
D
// https://issues.dlang.org/show_bug.cgi?id=2450
|
|
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/fail2450.d(22): Error: function expected before `()`, not `this.mixin Event!() clicked;
|
|
` of type `void`
|
|
fail_compilation/fail2450.d(25): Error: function expected before `()`, not `b.mixin Event!() clicked;
|
|
` of type `void`
|
|
---
|
|
*/
|
|
|
|
template Event()
|
|
{
|
|
void opCall() { }
|
|
void opAddAssign(int i) { }
|
|
}
|
|
class Button {
|
|
mixin Event clicked;
|
|
void func()
|
|
{
|
|
clicked.opCall(); // works
|
|
this.clicked(); // works
|
|
|
|
auto b = new Button();
|
|
b.clicked(); // works
|
|
}
|
|
}
|