Bug 7903 – [TDPL] public member variables are supposed to be illegal in synchronized classes
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-04-13T21:22:00Z
Last change time
2016-01-03T14:02:00Z
Keywords
accepts-invalid, pull, TDPL
Assigned to
andrej.mitrovich
Creator
issues.dlang
Comments
Comment #0 by issues.dlang — 2012-04-13T21:22:30Z
Per TDPL (p. 419), it's illegal to have public member variables in synchronized classes, but this compiles:
synchronized class C
{
int i;
}
Comment #1 by andrej.mitrovich — 2014-01-06T11:53:56Z
Also in TDPL:
- Access to protected members is restricted to methods of the class and its descendants (ed: not sure what's different about this one?)
- Access to private members is restricted to methods of the class
Comment #2 by andrej.mitrovich — 2014-01-06T12:23:26Z
Comment #3 by andrej.mitrovich — 2014-01-06T12:24:54Z
(In reply to comment #2)
> https://github.com/D-Programming-Language/dmd/pull/3067
(In reply to comment #1)
> Also in TDPL:
>
> - Access to protected members is restricted to methods of the class and its
> descendants (ed: not sure what's different about this one?)
> - Access to private members is restricted to methods of the class
Not implemented in the above pull. I can work on these later, although I still need elaboration on what the first item means. Perhaps Andrei meant that protected members will not be accessible from within the same module just like the private members?
Comment #4 by bugzilla — 2014-01-06T20:48:53Z
The spec is the spec, not TDPL, so these should be accompanied by a pull request on the spec.
Comment #5 by andrej.mitrovich — 2014-01-07T00:54:54Z
(In reply to comment #4)
> The spec is the spec, not TDPL, so these should be accompanied by a pull
> request on the spec.
As soon as we have a passing and merged pull I'll make an accompanying pull. Otherwise there's not much point in making two pulls when one of the pulls might take months to merge (forcing the dev to rebase two pulls instead of just one).
Comment #6 by github-bugzilla — 2015-10-19T16:41:14Z