Bug 19301 – [DIP1000] missing overload abilities

Status
RESOLVED
Resolution
WONTFIX
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-10-12T06:34:24Z
Last change time
2020-03-04T10:14:09Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
Илья Ярошенко

Comments

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.