https://issues.dlang.org/show_bug.cgi?id=17910
--- Comment #5 from Steven Schveighoffer <[email protected]> --- (In reply to anonymous4 from comment #4) > (In reply to Steven Schveighoffer from comment #3) > > make your extension methods global > > This destroys encapsulation: what has no business at global scope shouldn't > be there. Using clear(b) does not destroy encapsulation. > > > D usually frowns upon having the > > same code mean different things in different contexts. > > This is not the case for UFCS. Correct, it is not because local functions do not supersede global ones for UFCS. void foo(int) {} void main() { void foo(int) {} 1.foo; // calls global foo } --
