How do i find a list of the methods Object implements, or maybe just locate the 'write' method?
bauss
jj_1337 at live.dk
Wed Nov 8 12:17:14 UTC 2017
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);
}
```
More information about the Digitalmars-d-learn
mailing list