On Thursday, 22 February 2018 at 21:12:45 UTC, JN wrote:
Is this expected behaviour?
bar.d
---
void foo(string s)
{
}
app.d
---
import std.stdio;
import bar;
void foo(int x)
{
}
void main()
{
foo("hi");
};
===
Error: function app.foo (int x) is not callable using argument
types (string
JN wrote:
same idea?
absolutely the same. non-qualified imports (be it template, or function)
won't take part in overload resoultion.
On Thursday, 22 February 2018 at 21:19:12 UTC, ketmar wrote:
yes. this is done so unqualified won't silently "steal" your
functions. this can cause some unexpected (and hard to find)
bugs.
if you want it to work, you can either do qualified import
import bar : foo;
or manuall bring
JN wrote:
Is this expected behaviour?
bar.d
---
void foo(string s)
{
}
app.d
---
import std.stdio;
import bar;
void foo(int x)
{
}
void main()
{
foo("hi");
};
===
Error: function app.foo (int x) is not callable using argument types
(string)
yes. this is done so unqualified won't si