On Wednesday, 8 November 2017 at 03:48:58 UTC, codephantom wrote:
On Wednesday, 8 November 2017 at 03:33:08 UTC, bauss wrote:
--------------------------------------------------------------------------

Compiles fine with DMD: https://dpaste.dzfl.pl/95b896aa242f


ahh.. that site saves it with some random temporary file name I assume.

If it saved it as write.d, it likely would not compile, unless they were using gdc.

That's because the module name becomes `write` then.

Generally you should be explicit about module names anyway, unless you have a single file for testing or something.

You could get around the error using an alias:

```
module write;

import std.stdio;
alias write = std.stdio.write; // <<<<<<

void main()
{
    auto o = new Object;

    o.write;
    write(o);

}
```

Reply via email to