Comment #0 by ilyayaroshenko — 2018-10-12T06:34:24Z
struct D
{
const(char)[] d;
this(scope const(char)[] d) @safe
{
this.d = "static_string";
}
this(string d) @safe
{
this.d = d;
}
}
D func(scope string s) @safe
{
return D(s);
}
---------
Error: scope variable s assigned to non-scope parameter d calling mir.exception.D.this
Expected behavior: pass using `this(scope const(char)[] d)`
Comment #1 by bugzilla — 2020-03-04T10:14:09Z
scope is deliberately not overloaded upon, as it would seem to be a very bizarre use case to do so.
Adding this would require significant discussion and evaluation, including compelling use cases. I.e. a DIP would be needed.