diff options
Diffstat (limited to 'gcc/testsuite/gdc.test/fail_compilation/fail10806.d')
-rw-r--r-- | gcc/testsuite/gdc.test/fail_compilation/fail10806.d | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail10806.d b/gcc/testsuite/gdc.test/fail_compilation/fail10806.d new file mode 100644 index 00000000000..48f35371ddc --- /dev/null +++ b/gcc/testsuite/gdc.test/fail_compilation/fail10806.d @@ -0,0 +1,18 @@ +/* +TEST_OUTPUT: +--- +fail_compilation/fail10806.d(12): Error: function `fail10806.Class.clone` incompatible covariant types `First()` and `Second()` +--- +*/ + +interface First { First clone(); } +interface Second { Second clone(); void call(); } + +class Class : First, Second { + override Class clone() { return this; } + override void call() { } +} + +void main() { + (cast(Second) new Class).clone().call(); +} |