Extending D's support for object-oriented design with private(this)
Nick Treleaven
nick at geany.org
Thu Apr 25 13:35:29 UTC 2024
It should say whether __traits(getMember), allMembers and
.tupleof can access private(this) members.
private(this) maybe should be the default for synchronized
classes.
BTW regarding unit tests, I would like to have `public unittest`
disallow access to anything non public. Perhaps if accepted,
there could later be private(this) to opt-in to accessing those
fields. That is important when the class is a template and you
don't want the test instantiated every time the template is
instantiated.
More information about the dip.ideas
mailing list