This also happens with ref and plain types.
----
void test1(ref const char[] val) {}
void main() {
string a;
test1(a);
}
----
void test1(ref const(char) val) {}
void main() {
immutable char a;
test1(a);
}
----
Comment #3 by code — 2012-12-07T11:42:23Z
(In reply to comment #2)
> This also happens with ref and plain types.
>
Does an implicit const cast means to become an rvalue.
But still auto ref and implicit const cast doesn't work for integral types too.
void test1()(auto ref const char val) {}
void main() {
immutable char a;
test1(a);
}
Comment #4 by github-bugzilla — 2012-12-07T19:01:04Z