Public Private members?
bauss
jj_1337 at live.dk
Wed Apr 17 04:45:52 UTC 2019
On Monday, 15 April 2019 at 19:10:16 UTC, H. S. Teoh wrote:
> On Mon, Apr 15, 2019 at 05:56:31PM +0000, bauss via
> Digitalmars-d wrote:
>> On Monday, 15 April 2019 at 17:38:15 UTC, Flying-Toast wrote:
>> > I am not sure if this is a bug or if there is some
>> > explanation for this behavior, but either way it is
>> > confusing and I think it should cause an Error.
>> >
>> > ---
>> > class A {
>> > private {
>> > public int a;//No Error???
>> > }
>> >
>> > private public string s;//Error, expected
>> > }
>> > ---
>> >
>> > https://run.dlang.io/is/odJDnA
>>
>> I would argue that it's indeed a bug.
>
> It's a feature. (Though one that I would rather term as a
> misfeature, since it makes code needlessly hard to read.) The
> main purpose is to allow you to countermand the 'private'
> inside a large block of private members.
>
>
> T
The feature would have been much more useful if you could do it
with final tbh.
More information about the Digitalmars-d
mailing list