[Issue 14161] UFCS call does not abide by scope

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Feb 10 07:21:49 PST 2015


https://issues.dlang.org/show_bug.cgi?id=14161

--- Comment #6 from Ketmar Dark <ketmar at ketmar.no-ip.org> ---
Fyodor is not talking about "fixing" UFCS. what he talking about is issuing a
warning when there is local declaration with the same name as global one, and
global one was chosen by UFCS.

here compiler should issue warning that "global 'f' chosen for UFCS instead of
local one". yes, this is by spec, but sometimes people forgetting about this
and expecting local call. the code compiles fine, but does wrong things, and
this can be very puzzling.

yet this is against the "D is only for smarts", so i don't think that such
warning will be added. the standard answer to this is "use lint tool instead" —
as for some other warnings that affects newcomers, who don't want to run lint
each time. D is inherently hostile to newcomers.

--


More information about the Digitalmars-d-bugs mailing list