www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 24216] New: All symbols from object are publicly imported

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

          Issue ID: 24216
           Summary: All symbols from object are publicly imported into
                    every module
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: schveiguy gmail.com

Has happened all the way back to at least 2.060

```d
import std.math;

std.math.string s = "hello";
```

Substitute `std.math` for any other module (including a completely empty
module). Substitute `string` for any other symbol in object.d.

As long as the module doesn't redefine that symbol, it's a pass-through for
object symbols.

Fully-qualified-names should only resolve to names defined within that module.

--
Nov 01 2023