| 1 |
/* |
| 2 |
REQUIRED_ARGS: -checkaction=context |
| 3 |
EXTRA_SOURCES: extra-files/minimal/object.d |
| 4 |
*/ |
| 5 |
|
| 6 |
/************************************************************/ |
| 7 |
|
| 8 |
/* |
| 9 |
TEST_OUTPUT: |
| 10 |
--- |
| 11 |
fail_compilation/verifyhookexist.d(22): Error: `object.__ArrayCast` not found. The current runtime does not support casting array of structs, or the runtime is corrupt. |
| 12 |
fail_compilation/verifyhookexist.d(28): Error: `object.__equals` not found. The current runtime does not support equal checks on arrays, or the runtime is corrupt. |
| 13 |
fail_compilation/verifyhookexist.d(29): Error: `object.__cmp` not found. The current runtime does not support comparing arrays, or the runtime is corrupt. |
| 14 |
fail_compilation/verifyhookexist.d(33): Error: `object._d_assert_fail` not found. The current runtime does not support generating assert messages, or the runtime is corrupt. |
| 15 |
fail_compilation/verifyhookexist.d(36): Error: `object.__switch` not found. The current runtime does not support switch cases on strings, or the runtime is corrupt. |
| 16 |
fail_compilation/verifyhookexist.d(41): Error: `object.__switch_error` not found. The current runtime does not support generating assert messages, or the runtime is corrupt. |
| 17 |
--- |
| 18 |
*/ |
| 19 |
|
| 20 |
struct MyStruct { int a, b; } |
| 21 |
MyStruct[] castToMyStruct(int[] arr) { |
| 22 |
return cast(MyStruct[])arr; |
| 23 |
} |
| 24 |
|
| 25 |
void test() { |
| 26 |
int[] arrA, arrB; |
| 27 |
|
| 28 |
bool a = arrA[] == arrB[]; |
| 29 |
bool b = arrA < arrB; |
| 30 |
|
| 31 |
{ |
| 32 |
int x = 1; int y = 1; |
| 33 |
assert(x == y); |
| 34 |
} |
| 35 |
|
| 36 |
switch ("") { |
| 37 |
default: |
| 38 |
break; |
| 39 |
} |
| 40 |
|
| 41 |
final switch (0) { |
| 42 |
case 1: |
| 43 |
break; |
| 44 |
} |
| 45 |
} |