Debian Codegraph @

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

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/diag10415.d(36): Error: none of the overloads of `x` are callable using argument types `(int) const`
5 fail_compilation/diag10415.d(13): Candidates are: `diag10415.C.x() const`
6 fail_compilation/diag10415.d(18): `diag10415.C.x(int __param_0)`
7 fail_compilation/diag10415.d(39): Error: d.x is not an lvalue
8 ---
9 */
10
11 class C
12 {
13 @property int x() const
14 {
15 return 0;
16 }
17
18 @property void x(int)
19 {
20 }
21 }
22
23 template AddProp() { @property int x() { return 1; } }
24 template AddFunc() { void x(int, int) {} }
25
26 class D
27 {
28 // overloadset
29 mixin AddProp;
30 mixin AddFunc;
31 }
32
33 void main()
34 {
35 const c = new C();
36 c.x = 1;
37
38 auto d = new D();
39 d.x = 1;
40 }