| 1 |
/* |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/diag8318.d(18): Error: function `diag8318.Bar8318.foo` return type inference is not supported if may override base class function |
| 5 |
fail_compilation/diag8318.d(23): Error: function `diag8318.C10021.makeI` return type inference is not supported if may override base class function |
| 6 |
fail_compilation/diag8318.d(31): Error: function `diag8318.Bar10195.baz` return type inference is not supported if may override base class function |
| 7 |
fail_compilation/diag8318.d(37): Error: function `diag8318.B14173.foo` does not override any function |
| 8 |
fail_compilation/diag8318.d(23): Error: class `diag8318.C10021` interface function `I10021 makeI()` is not implemented |
| 9 |
fail_compilation/diag8318.d(29): Error: class `diag8318.Bar10195` interface function `int baz()` is not implemented |
| 10 |
--- |
| 11 |
*/ |
| 12 |
class Foo8318 |
| 13 |
{ |
| 14 |
auto foo() { return "Foo.foo"; } |
| 15 |
} |
| 16 |
class Bar8318 : Foo8318 |
| 17 |
{ |
| 18 |
override auto foo() { return "Bar.foo"; } |
| 19 |
} |
| 20 |
|
| 21 |
interface I10021 { I10021 makeI(); } |
| 22 |
class D10021 : I10021 { D10021 makeI() { return this; } } |
| 23 |
class C10021 : I10021 { auto makeI() { return this; } } |
| 24 |
|
| 25 |
interface Foo10195 |
| 26 |
{ |
| 27 |
int baz(); |
| 28 |
} |
| 29 |
class Bar10195 : Foo10195 |
| 30 |
{ |
| 31 |
override auto baz() { return 1; } |
| 32 |
} |
| 33 |
|
| 34 |
class A14173 {} |
| 35 |
class B14173 : A14173 |
| 36 |
{ |
| 37 |
override foo() {} |
| 38 |
} |