Debian Codegraph @

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

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/ufcs.d(31): Error: no property `regularF` for `s` of type `S`
5 fail_compilation/ufcs.d(31): the following error occured while looking for a UFCS match
6 fail_compilation/ufcs.d(31): Error: function `regularF` is not callable using argument types `(S)`
7 fail_compilation/ufcs.d(31): expected 0 argument(s), not 1
8 fail_compilation/ufcs.d(39): `ufcs.regularF()` declared here
9 fail_compilation/ufcs.d(32): Error: no property `templateF` for `s` of type `S`
10 fail_compilation/ufcs.d(32): the following error occured while looking for a UFCS match
11 fail_compilation/ufcs.d(32): Error: template `templateF` is not callable using argument types `!()(S)`
12 fail_compilation/ufcs.d(40): Candidate is: `templateF()()`
13 fail_compilation/ufcs.d(33): Error: no property `templateO` for `s` of type `S`
14 fail_compilation/ufcs.d(33): the following error occured while looking for a UFCS match
15 fail_compilation/ufcs.d(33): Error: none of the overloads of template `ufcs.templateO` are callable using argument types `!()(S)`
16 fail_compilation/ufcs.d(42): Candidates are: `templateO()(int x)`
17 fail_compilation/ufcs.d(43): `templateO()(float y)`
18 fail_compilation/ufcs.d(36): Error: no property `local` for `s` of type `ufcs.S`
19 fail_compilation/ufcs.d(35): cannot call function `local` with UFCS because it is not declared at module scope
20 fail_compilation/ufcs.d(26): struct `S` defined here
21 ---
22 */
23
24
25
26 struct S { }
27
28 void f()
29 {
30 S s;
31 s.regularF();
32 s.templateF();
33 s.templateO();
34
35 void local(S) {}
36 s.local();
37 }
38
39 void regularF();
40 void templateF()();
41
42 void templateO()(int x);
43 void templateO()(float y);