[Issue 7196] New: Unfair function address overload resolution
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Jan 1 17:25:51 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7196
Summary: Unfair function address overload resolution
Product: D
Version: unspecified
Platform: Other
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: timon.gehr at gmx.ch
--- Comment #0 from timon.gehr at gmx.ch 2012-01-01 17:25:50 PST ---
Tested with DMD 2.057
auto foo(int x){return x;}
auto foo(double x){return x;}
void main() {
auto x = (&foo)(1); // ok
auto y = (&foo)(1.0); // fail
}
Error: cannot implicitly convert expression (1) of type double to int
The code should either compile, or both lines should fail.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list