Debian Codegraph @

gcc/testsuite/gdc.test/fail_compilation/fail11591b.d

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail11591b.d(16): Error: AA key type `S11591` does not have `bool opEquals(ref const S11591) const`
5 ---
6 */
7
8 struct S11591
9 {
10 bool opEquals(int i) { return false; }
11 Object o; // needed to suppress compiler generated opEquals
12 }
13
14 void test11591()
15 {
16 int[S11591] aa;
17 }
18
19 /*
20 TEST_OUTPUT:
21 ---
22 fail_compilation/fail11591b.d(30): Error: AA key type `S12307a` does not have `bool opEquals(ref const S12307a) const`
23 fail_compilation/fail11591b.d(31): Error: AA key type `S12307b` does not have `bool opEquals(ref const S12307b) const`
24 ---
25 */
26 struct S12307a { bool opEquals(T : typeof(this))(T) { return false; } }
27
28 void test12307()
29 {
30 int[S12307a] aa1; // a
31 int[S12307b] aa2; // b
32 }
33
34 struct S12307b { bool opEquals(T : typeof(this))(T) { return false; } }