| 1 |
/* |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/test13867.d(12): Error: function `void test13867.X.blah()` does not override any function, did you mean to override `extern (C++) void test13867.Base.blah()`? |
| 5 |
fail_compilation/test13867.d(19): Error: function `void test13867.Z.blah()` does not override any function, did you mean to override `extern (C++) void test13867.Base.blah()`? |
| 6 |
--- |
| 7 |
*/ |
| 8 |
extern (C++) class Base { |
| 9 |
void blah() {} |
| 10 |
} |
| 11 |
class X : Base { |
| 12 |
override void blah();//Error |
| 13 |
} |
| 14 |
extern (C++) class Y : Base { |
| 15 |
override void blah(){} |
| 16 |
} |
| 17 |
class Z : Base { |
| 18 |
alias blah = typeof(super).blah; |
| 19 |
override void blah(){}//Error |
| 20 |
} |
| 21 |
class O : Base { |
| 22 |
extern (C++) override void blah(){} |
| 23 |
} |
| 24 |
extern (C++) class OK : Base { |
| 25 |
alias blah = typeof(super).blah; |
| 26 |
override void blah(){} |
| 27 |
} |
| 28 |
|
| 29 |
void main() { |
| 30 |
scope b = new Base(); |
| 31 |
b.blah(); |
| 32 |
scope x = new X(); |
| 33 |
x.blah(); |
| 34 |
scope y = new Y(); |
| 35 |
y.blah(); |
| 36 |
scope o = new O(); |
| 37 |
o.blah(); |
| 38 |
scope z = new Z(); |
| 39 |
z.blah(); |
| 40 |
} |