Debian Codegraph @

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

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail10806.d(12): Error: function `fail10806.Class.clone` incompatible covariant types `First()` and `Second()`
5 ---
6 */
7
8 interface First { First clone(); }
9 interface Second { Second clone(); void call(); }
10
11 class Class : First, Second {
12 override Class clone() { return this; }
13 override void call() { }
14 }
15
16 void main() {
17 (cast(Second) new Class).clone().call();
18 }