std.functional.compose compilation error

bachmeier via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Aug 25 10:49:26 PDT 2016


On Thursday, 25 August 2016 at 15:04:43 UTC, Jonathan M Davis 
wrote:

> Yes. Because the module is compose, within that file, compose 
> will refer to the module, not anything you import. The 
> selective import essentially creates a local alias like
>
> alias compose = std.functional.compose;
>
> as part of the import, so then within that scope, compose 
> refers to that alias and not to the module. You'll run into the 
> same problem any time that you give a module the same name as a 
> symbol that you're importing.
>
> - Jonathan M Davis

Is there a reason there is not a warning for this when compiling? 
I think it explains a problem I had some time ago that cost me a 
lot of time.


More information about the Digitalmars-d-learn mailing list