Bug 13140 – auto ref should support implicit conversion

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2014-07-16T12:39:56Z
Last change time
2024-12-13T18:22:13Z
Assigned to
No Owner
Creator
Martin Nowak
Moved to GitHub: dmd#18850 →

Comments

Comment #0 by code — 2014-07-16T12:39:56Z
cat > bug.d << CODE void foo(T)(auto ref T t) { } void bar() { int v = 12; foo!long(v); } CODE ---- dmd -c bug ---- bug.d(8): Error: template bug.foo cannot deduce function from argument types !(long)(int), candidates are: bug.d(1): bug.foo(T)(auto ref T t) ---- The compiler seems to reject this because it tries to bind the lvalue argument via reference. IMO implicit conversion of arguments types should be run before determining lvalueness to resolve this.
Comment #1 by robert.schadek — 2024-12-13T18:22:13Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18850 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB