1 /* REQUIRED_ARGS: -preview=dip1021
8 fail_compilation/test1021.d(1009): Error: more than one mutable reference of `p` in arguments to `test1021.fooa()`
9 fail_compilation/test1021.d(1010): Error: mutable and const references of `p` in arguments to `test1021.foob()`
10 fail_compilation/test1021.d(1011): Error: mutable and const references of `p` in arguments to `test1021.fooc()`
11 fail_compilation/test1021.d(1013): Error: more than one mutable reference of `p` in arguments to `test1021.fooe()`
17 void fooa(int*, int*);
18 void foob(const(int)*, int*);
19 void fooc(int*, const(int)*);
20 void food(const(int)*, const(int)*);
32 /***********************************/
36 fail_compilation/test1021.d(2010): Error: more than one mutable reference to `i` in arguments to `test1021.fopa()`
37 fail_compilation/test1021.d(2011): Error: mutable and const references to `i` in arguments to `test1021.fopb()`
38 fail_compilation/test1021.d(2012): Error: mutable and const references to `i` in arguments to `test1021.fopc()`
39 fail_compilation/test1021.d(2014): Error: more than one mutable reference to `i` in arguments to `test1021.fope()`
45 void fopa(ref int, scope int*);
46 void fopb(ref int, scope const int*);
47 void fopc(ref const int, scope int*);
48 void fopd(ref const int, scope const int*);
49 inout(int) fope(ref inout int, scope int*);
53 @trusted int* toPtr(ref int i
) { return &i
; }
54 fopa(i
, toPtr(i
)); // error
55 fopb(i
, toPtr(i
)); // error
56 fopc(i
, toPtr(i
)); // error
57 fopd(i
, toPtr(i
)); // ok
58 fope(i
, toPtr(i
)); // error
61 /***********************************/
65 fail_compilation/test1021.d(3015): Error: more than one mutable reference to `s` in arguments to `test1021.S.method()`
66 fail_compilation/test1021.d(3019): Error: more than one mutable reference of `c` in arguments to `test1021.C.method()`
93 /***********************************/
97 fail_compilation/test1021.d(4008): Error: more than one mutable reference to `i` in arguments to `test1021.test4.nested()`
106 int nested(ref int j
)
114 /***********************************/
118 fail_compilation/test1021.d(5012): Error: more than one mutable reference of `s` in arguments to `test1021.foo5()`
138 alias A5
= void delegate() const;
148 alias B5
= void function();