See the following code: import std.stdio;
void foo(ref int x)
{
writefln("%s", x);
}
void main(string[] args)
{
int y = 0;
foo(y++);
}
When compiled it produces this error:
test.d(11): Error: function test.foo (ref int x) is not callable
using argument types (int)
If I remove the post-increment of the y variable if works. Is this an rvalue reference issue? Would you expect this to work? Should the error message be a little more helpful?
