[Issue 19014] New: Compiler imports symbols that aren't actually imported.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jun 22 01:43:37 UTC 2018


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

          Issue ID: 19014
           Summary: Compiler imports symbols that aren't actually
                    imported.
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: slavo5150 at yahoo.com

The following code works as expected:

--- Example 1
void main()
{
    if (true)
    {
        static import core.stdc.math;
    }
    static assert(!__traits(compiles, core.stdc.math.cos(0))); 
}
---

The following code does not work as expected:

--- Example 2
import core.stdc.config;

void main()
{
    if (true)
    {
        static import core.stdc.math;
    }
    static assert(!__traits(compiles, core.stdc.math.cos(0))); 
}
---

When importing `core.stdc.config` it also appears to import `core.stdc.math`
although `core.stdc.config` does not import anything.

--


More information about the Digitalmars-d-bugs mailing list