On Saturday, January 27, 2018 13:29:00 kdevel via Digitalmars-d-learn wrote: > What's wrong here? And why is the "selective import" of enforce > necessary?
Because you named your module enforce. As such, by default, referring to enforce inside of the module refers to the module. Having the selective import overrides that. It's generally not a good idea to name your module the same name something that you would refer to inside the module. It's usually not an issue in real programs, because in that case, aside from maybe the module with main, modules aren't at the top-level, but if you're doing something like naming your test program after a function that you're using in it, you're going to have problems. - Jonathan M Davis