[Issue 2991] New: Import within aggregate causes conflicts with private identifiers

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat May 16 06:44:32 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2991

           Summary: Import within aggregate causes conflicts with private
                    identifiers
           Product: D
           Version: 1.043
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: matti.niemenmaa+dbugzilla at iki.fi


The following two-file code doesn't compile:

b.d:
  private void foo() {}

a.d:
  void foo() {}

  class C {
    import b;

    void bar() { foo(); }
  }

The resulting errors from 'dmd -c a.d':

a.d(3): Error: class a.C b.foo is private
a.d(6): Error: function b.foo is not accessible from a

If the import and/or function bar are moved to the global scope, the code is
accepted. The private identifier from module b shouldn't be visible in module
a, so no error should result.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list