April 21, 2023
https://issues.dlang.org/show_bug.cgi?id=23850

          Issue ID: 23850
           Summary: Differentiate between a module that is in binary vs
                    outside of binary when including -I
           Product: D
           Version: D2
          Hardware: All
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody@puremagic.com
          Reporter: alphaglosined@gmail.com

The compiler must have a way of differentiating between a module that is being compiled into the binary and is outside of it (i.e. in a shared library).

1. It allows for the compiler to error if a templated symbol when instantiated
references a non-exported symbol when the non-exported symbol is in another
binary.
2. Allows automatic differentiation between DllImport and internal of symbols
marked export.
3. Prevent placing a requirement of a module outside of the binary to have a
ModuleInfo generated for it triggered by unittests.

The cheapest way to do this for both package/build managers will be to add a second -I switch that sets the flag on a module node.

--