Weekly D updates 5th-12th August 2022

Max Samukha maxsamukha at gmail.com
Tue Sep 20 06:07:18 UTC 2022


On Monday, 19 September 2022 at 12:09:00 UTC, Adam D Ruppe wrote:

> Another newer bug is about alias this and private, closed 
> because it is by design that you can't have a public alias to a 
> private member.

Not always:

module a;
private int _x;
alias x = _x;

module b:
import a;

void main() { x = 1; // ok }

> Makes enough sense to go ahead and make it official that this 
> isn't going to change.

Public aliases make sense if you believe that:
```
private int _x;
alias x = _x;
```
should be equivalent to
```
private int _x;
@property ref int x() => _x;
```
That is, the visibility attribute applies to the name, not the 
named item.


More information about the Digitalmars-d mailing list