MATCH: Improve `A CMP 0 ? A : -A` set of patterns to use bitwise_equal_p.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / diag_in_array.d
blobf869b32856cc86ccc1f8d46ea9e69dd6cfd71cd3
1 /**
2 TEST_OUTPUT:
3 ---
4 fail_compilation/diag_in_array.d(17): Error: incompatible types for `(3) in (a)`: `int` and `int[4]`
5 fail_compilation/diag_in_array.d(17): `in` is only allowed on associative arrays
6 fail_compilation/diag_in_array.d(17): perhaps use `std.algorithm.find(3, a[])` instead
7 fail_compilation/diag_in_array.d(19): Error: incompatible types for `("s") in (b)`: `string` and `string[]`
8 fail_compilation/diag_in_array.d(19): `in` is only allowed on associative arrays
9 fail_compilation/diag_in_array.d(19): perhaps use `std.algorithm.find("s", b)` instead
10 ---
13 void main()
15 int[4] a;
16 string[] b;
17 if (3 in a)
18 return;
19 auto c = "s" in b;