Debian Codegraph @

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

raw
1 /* REQUIRED_ARGS: -preview=bitfields
2 * TEST_OUTPUT:
3 ---
4 fail_compilation/test16188.d(101): Error: no property `name` for `Where()` of type `test16188.Where`
5 fail_compilation/test16188.d(107): Error: undefined identifier `getMember`
6 fail_compilation/test16188.d(101): Error: template instance `test16188.Where.opDispatch!"name"` error instantiating
7 ---
8 */
9
10 // https://issues.dlang.org/show_bug.cgi?id=16188
11
12 /* This produces the message:
13 * Error: no property 'name' for type 'Where'
14 * when the actual error is 'getMember is undefined'.
15 * This happens because errors are gagged when opDispatch() is compiled,
16 * I don't understand why.
17 */
18
19 #line 100
20
21 void where() { Where().name; }
22
23 struct Where
24 {
25 void opDispatch(string name)()
26 {
27 alias FieldType = typeof(getMember);
28 WhereField!FieldType;
29 }
30 }
31
32 struct WhereField(FieldType) {}