[Issue 2830] private attribute doesn't work for structs/unions/classes

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 10 07:59:37 PDT 2009


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


gide at nwawudu.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |313, 314
            Summary|private attribute doesn't   |private attribute doesn't
                   |work for structs            |work for
                   |                            |structs/unions/classes




------- Comment #1 from gide at nwawudu.com  2009-04-10 09:59 -------
Structs, unions, classes and variables can bypass the private attribute.
Similar to BUG 313 and BUG 314, added dependancies.

tmp1.d
------
private struct TestStruct {
    int var;
}

private union TestUnion {
    int var;
}

private class TestClass {
    int var;
}

private int var;

tmp.d
-----
import tmp1;

void main() {
    TestStruct s;
    TestUnion u;
    auto c = new TestClass;
    s.var = var; // Fails
    s.var = a.var; // OK
}


-- 



More information about the Digitalmars-d-bugs mailing list