[Issue 11234] New: Method of another module is callable, even if they is private.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Oct 12 12:20:10 PDT 2013


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

           Summary: Method of another module is callable, even if they is
                    private.
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: rswhite4 at googlemail.com


--- Comment #0 from rswhite4 at googlemail.com 2013-10-12 12:20:03 PDT ---
A.d:
----
import B;

class Foo {
public:
    void call(Bar b) {
        void delegate(int) dg = &b.test;
        dg(42);
    }
}

void main() {
    Bar b = new Bar();
    Foo f = new Foo();
    f.call(b);
}
----

B.d:
----
import std.stdio;

class Bar {
private:
    void test(int id) {
        writeln("Bar called with ", id);
    }
}
----

Output: Bar called with 42
But should be rejected.

-- 
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