[Issue 21895] New: Module in package incorrectly accessible when it was not explicitly imported

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu May 6 08:16:35 UTC 2021


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

          Issue ID: 21895
           Summary: Module in package incorrectly accessible when it was
                    not explicitly imported
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: eyal at weka.io

With the following separate modules defined:

-----------------

  module pkg.a;

-----------------

  module pkg.b;

  import pkg.a;

-----------------

  module test;

  import pkg.b;

  // pkg.a is now incorrectly usable, without being imported

-----------------

If we remove the import of pkg.a in pkg.b, then module test suddenly does need
to import pkg.a.

Whether or not 'pkg.b' imports 'pkg.a' is an implementation detail of 'pkg.b',
so should not affect module 'test's accessibility of 'pkg.a'.

--


More information about the Digitalmars-d-bugs mailing list