Debian Codegraph @

gcc/testsuite/gdc.test/fail_compilation/fail8631.d

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail8631.d(14): Error: function `shared const int fail8631.D.foo()` does not override any function, did you mean to override `immutable int fail8631.B.foo()`?
5 ---
6 */
7
8 class B {
9 int foo() immutable { return 2; }
10 int foo() const { return 2; }
11 }
12 class D : B {
13 override int foo() immutable { return 2; }
14 override int foo() const shared { return 2; } // doesn't override any
15 override int foo() const { return 2; }
16 }