Bug?

Adam D. Ruppe destructionator at gmail.com
Mon May 11 12:30:22 UTC 2020


On Monday, 11 May 2020 at 12:20:06 UTC, Jack Applegame wrote:
> If you move the import to the global scope

UFCS is only defined to work with global scope functions. A 
restricted import (module : symbol, symbols) puts things in local 
scope so ufcs doesn't apply.

(interestingly an unrestricted import does NOT do that, it keeps 
the functions in their original scope, so UFCS works if you 
locally `import std.range;` but not if you `import std.range : 
front, popFront, empty;`! lol. but this is... im pretty sure by 
design, it has been this way for ages.)


More information about the Digitalmars-d-learn mailing list