gcc/testsuite/gdc.test/fail_compilation/test23552.d
raw| 1 | // https://issues.dlang.org/show_bug.cgi?id=23552 |
| 2 | |
| 3 | /* |
| 4 | TEST_OUTPUT: |
| 5 | --- |
| 6 | fail_compilation/test23552.d(17): Error: cannot implicitly override base class method `test23552.Base.foo` with `test23552.Derived.foo`; add `override` attribute |
| 7 | --- |
| 8 | */ |
| 9 | |
| 10 | abstract class Base |
| 11 | { |
| 12 | void foo(); |
| 13 | } |
| 14 | |
| 15 | class Derived : Base |
| 16 | { |
| 17 | void foo() { } |
| 18 | int data() { return 0; } |
| 19 | } |
| 20 | |
| 21 | class DerivedX : Derived |
| 22 | { |
| 23 | override int data() { return 1; } |
| 24 | } |