On Sunday, 16 July 2017 at 09:01:46 UTC, kdevel wrote:
On Monday, 2 April 2012 at 22:20:13 UTC, bearophile wrote:

For DMD choosing one or the other is arbitrary. It's a defect of the way the D module system is designed.

Ran into that problem with a Module S containing

   module S;
   import std.stdio;
   struct S {
      this (string s)
      {
         writeln ("S: " ~ s);
      }
   }

This code

// auto s1 = S("X"); // useS.d(6): Error: function expected before (), not module S of type void

would not compile while

   S s3 = "X"; // OK

works. Has this issue been filed in bugzilla?

I hit this one recently and other variations before, a function or local variable name clashing with a struct type name:

http://forum.dlang.org/thread/[email protected]
https://github.com/joakim-noah/android/commit/7e35c3ccd3a9d6ea870d39af44d9b11802c17a43

It probably generally has to do with keeping names unique in the symbol namespace because of all the cool stuff you can do interchangeably at compile-time, but I'm not sure how that extends to module names too.

Reply via email to