Comment #0 by default_357-line — 2019-05-06T10:38:11Z
consider:
module test;
import std.stdio;
void fooInt(int i) { writefln("int %s", i); }
void fooFloat(float f) { writefln("float %s", f); }
void main()
{
import test : foo = fooInt;
import test : foo = fooFloat;
foo(5.0f);
}
This will error with "fooInt(int i) is not callable using argument types float", even though a perfectly serviceable overload is available under the name.
Comment #1 by witold.baryluk+d — 2021-08-22T11:20:20Z
I just got hit by similar issue:
void main()
import core.time : Duration, TickDuration, to;
import std.conv : to;
Duration dur;
dur.to!TickDuration();
}
onlineapp.d(6): Error: template `core.time.to` cannot deduce function from argument types `!(TickDuration)(Duration)`, candidates are:
/dlang/dmd/linux/bin64/../../src/druntime/import/core/time.d(1746): `to(string units, T, D)(D td)`
Moving imports to be at module level is a workaround.
Comment #2 by robert.schadek — 2024-12-13T19:03:12Z