https://issues.dlang.org/show_bug.cgi?id=14161
Issue ID: 14161
Summary: UFCS call does not abide by scope
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: DMD
Assignee: [email protected]
Reporter: [email protected]
If global function declared as same name to a local function pointer, UFCS will
call the global function.
Discovered: http://forum.dlang.org/post/[email protected]
> import std.stdio;
>
> void f(int a) {
> writeln("it's a function! : ", a);
> }
>
> void main() {
> auto f = function (int a) {writeln("It's a variable! : ", a);};
> 5.f();
> f(5);
> }
>
> Output:
>
> it's a function! : 5
> It's a variable! : 5
--