https://issues.dlang.org/show_bug.cgi?id=17729
[email protected] changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #1 from [email protected] --- Furthermore, it doesn't work with ref parameters either: --- struct S { int i; } void fun(ref S s, int i) { s.i = i; } void main() { shared S s; /* This fails: onlineapp.d(17): Error: function onlineapp.fun(ref S s, int i) is not callable using argument types (S, int) onlineapp.d(17): cannot pass rvalue argument cast(S)s of type S to parameter ref S s fun(cast(S) s, 1); */ (*(cast (S*) &s)).fun(1); // Nasty workaround assert (s.i == 1); } --- I also can't understand why the workaround works at all, the result of dereferencing a pointer should surely be a rvalue? Is that also a bug? --
