| 1 |
/* REQUIRED_ARGS: -verrors=spec |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
(spec:1) fail_compilation/test17380spec.d(15): Error: cannot resolve identifier `ThisTypeDoesNotExistAndCrashesTheCompiler` |
| 5 |
(spec:1) fail_compilation/test17380spec.d(15): Error: no property `ThisTypeDoesNotExistAndCrashesTheCompiler` for `this.opCast()` of type `test17380spec.Uint128` |
| 6 |
(spec:1) fail_compilation/test17380spec.d(20): struct `Uint128` defined here |
| 7 |
fail_compilation/test17380spec.d(15): Error: undefined identifier `ThisTypeDoesNotExistAndCrashesTheCompiler` |
| 8 |
--- |
| 9 |
*/ |
| 10 |
|
| 11 |
struct Int128 |
| 12 |
{ |
| 13 |
Uint128 opCast() |
| 14 |
{ |
| 15 |
return ThisTypeDoesNotExistAndCrashesTheCompiler; |
| 16 |
} |
| 17 |
alias opCast this; |
| 18 |
} |
| 19 |
|
| 20 |
struct Uint128 |
| 21 |
{ |
| 22 |
Int128 opCast() { return Int128.init; } |
| 23 |
alias opCast this; |
| 24 |
} |