On Wednesday, 8 November 2017 at 12:17:14 UTC, bauss wrote:
That's because the module name becomes `write` then.


yeah I knew that.

I was trying to demonstrate how (when the module name is 'write'), then the compiler is ok with:

o.write;

but not:

write(o);

even though semantically they are meant to mean the same thing.

I also thought it was interesting the GDC doesn't seem to default the module namespace to the name of the file, or if it does, then it doesn't seem to have any conflict in resolving the correct namespace for the two statements(unlike DMD and LDC). Apparently its a bug in LDC (but personally, it's a bug I like).

Since the original post mentioned using gdc on debian, I just wanted to point this out - because it caught be my surprise a few days ago (as I test my code across different compilers, on different platforms).

Reply via email to