Problem with UFCS

Adam D. Ruppe destructionator at gmail.com
Tue Oct 16 09:28:14 PDT 2012


On Tuesday, 16 October 2012 at 16:12:06 UTC, Michael wrote:
> void main() {
> 	import std.range, std.stdio;

The problem is that UFCS only works on functions in the global 
scope. The import inside a function makes them local, so it 
doesn't consider them in it.

This is apparently by design; Walter said that just a couple 
weeks ago, though I don't have the link right now and don't 
remember what he said the reason was.

But if you move those imports outside the function the rest of 
your code will work.


More information about the Digitalmars-d-learn mailing list