September 11, 2008 [Issue 2357] New: compiler fails to choose an overload | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=2357 Summary: compiler fails to choose an overload Product: D Version: 2.019 Platform: PC OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla@digitalmars.com ReportedBy: snake.scaly@gmail.com The following code: import std.string; void main() { toString(5uL, 16); } when compiled, produces this output: >dmd -c test.d test.d(3): function std.string.toString called with argument types: (ulong,int) matches both: std.string.toString(long value, uint radix) and: std.string.toString(ulong value, uint radix) From my perspective the match is obvious. Marking this as rejects valid. The workaround is to call toString(5uL, 16u). -- |
September 12, 2008 [Issue 2357] compiler fails to choose an overload | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2357 svv1999@hotmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID ------- Comment #1 from svv1999@hotmail.com 2008-09-11 19:41 ------- Compiler acts according to the specs. On the second actual parameter both functions formal parameters match by implicit casting. This makes them belong to the same match priority. The fact that the first formal parameter of one function matches exact, is irrelevant. -- |
Copyright © 1999-2021 by the D Language Foundation