Bug 12279 – function local imports are not hijack safe
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-02-28T12:45:00Z
Last change time
2016-06-16T13:23:56Z
Assigned to
nobody
Creator
code
Comments
Comment #0 by code — 2014-02-28T12:45:29Z
cat > a.d << CODE
void kill(string) {}
CODE
cat > b.d << CODE
void kill(int, int) {}
void foo()
{
import a;
kill(0, 1);
}
CODE
dmd -c b.d
----
b.d(6): Error: function a.kill (string) is not callable using argument types (int, int)
----
Local imports should have the same overload/lookup behavior as global imports,
but they obey a lexical scope.
Comment #1 by dfj1esp02 — 2016-06-16T13:23:56Z
Fixed in issue 10378. Currently imported symbols are completely hidden by local symbols.
*** This issue has been marked as a duplicate of issue 10378 ***