Summary: Regarding module with name different from its file
           Product: D
           Version: 2.041
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from 2010-03-15 15:23:57 PDT ---
Two modules with file names different from the name used in the module


// File name: foo.d
module bar;
enum int x = 10;


// File name: spam.d
module test;
import foo: x;
void main() {}


When I compile the file spam.d I receive no errors from "spam" being different
fom "test". But I (think I) receive an error for "foo" being different from

spam.d(2): Error: module bar is in multiple packages bar

The compiler can try to give a better/more descriptive error message here.

In this situation if you want the compiler can even give two error messages,
complaining that inside the "spam.d" file it has a mismatch module name. If you
want to enforce this too, then I think in Tango there are modules that have a
name with the first letter upper case, but their file name is all lowercase, so
I think the comparison to assert that the module name is the same as the file
name is better done caseless (and because in Windows file names are essentially

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to