www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2283] New: protection attributes are not respected for struct opAssign

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2283

           Summary: protection attributes are not respected for struct
                    opAssign
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: 2korden gmail.com


struct Test {
    int i;
    private void opAssign(int i) {
        this.i = i;
    }
}

void main() {
    Test test;
    test = 42;  // accepted
}


-- 
Aug 14 2008
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2283


smjg iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg iname.com
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID





The access is in the same module, therefore this is allowed.

If they are placed in different modules, it fails as expected (1.036, 2.019).


-- 
Nov 24 2008