www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18123] New: non-package module accepted for package structure

https://issues.dlang.org/show_bug.cgi?id=18123

          Issue ID: 18123
           Summary: non-package module accepted for package structure
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: luis luismarques.eu

In the following forum post this issue has come up:

    http://forum.dlang.org/post/gnwgqexsifgbvkvmtutk forum.dlang.org

    file / module tree:

    .
    ├── foo
    │   └── bar.d
    └── foo.d

You have a foo package, but instead of having foo/package.d the user added a
foo.d file. Because the D frontend didn't detect this issue, the user was
confused. I believe that when a package is present, that package should not be
implementable as a non-package module (foo.d).

In this case, the compiler should detect that foo.d is present and complain
that foo/package.d should be used instead.

--
Dec 24 2017