Bug 6914 – wrong function of an overload set printed on argument mismatch

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-11-08T17:31:00Z
Last change time
2015-07-26T14:16:57Z
Keywords
diagnostic
Assigned to
nobody
Creator
hoganmeier

Comments

Comment #0 by hoganmeier — 2011-11-08T17:31:15Z
void foo(const char[] a) {} void foo(int i) {} void main() { size_t i; foo(i); } $ dmd -run test.d DMD v2.056 DEBUG test.d(8): Error: function test.foo (const const(char[]) a) is not callable using argument types (ulong) test.d(8): Error: cannot implicitly convert expression (i) of type ulong to int Little bit misleading.
Comment #1 by verylonglogin.reg — 2012-10-29T06:07:57Z
A note: example from the description is compiled in 64 bit code as you can see from the error: `...of type ulong to int`. So consider `size_t` == `ulong`.
Comment #2 by pro.mathias.lang — 2015-07-26T14:16:57Z
Nowadays it output the current message: test.d(8): Error: None of the overloads of 'foo' are callable using argument types (ulong), candidates are: test.d(1): lol.foo(const(char[]) a) test.d(3): lol.foo(int i) So I'll close.