www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21366] New: `private` ignored for circular imports


          Issue ID: 21366
           Summary: `private` ignored for circular imports
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: andy.pj.hanson gmail.com


import std.stdio : writeln;
import b : two;

void main() {

private int one() {
        return 1;


module b;

import app : one;

int two() {
        return one() + one();

Module `b` should not be allowed to import `one`, but it compiles without
error. (Ran `dmd app.d b.d`.)

Tested with `dmd --version` of `DMD64 D Compiler v2.094.1`.

Nov 06 2020