Open
Description
Steven Schveighoffer reported this on 2024-02-10T16:49:35Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=24385
Description
```d
import std.stdio;
void foo(ref int[2] val)
{
writeln("foo ref");
}
void foo(int[2] val)
{
writeln("foo non-ref");
}
void bar()(auto ref int[2] val)
{
static if(__traits(isRef, val))
writeln("bar ref");
else
writeln("bar non-ref");
}
void main()
{
int[4] x;
int[2] y;
foo(y); // foo ref
bar(y); // bar ref
foo(x[0 .. 2]); // foo ref
bar(x[0 .. 2]); // bar non-ref
}
```
They should all be ref for consistency.