[Issue 9809] Need a better diagnostic on accessing 'alias this' to private symbols

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 6 16:57:33 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=9809

Nick Treleaven <nick at geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |nick at geany.org
         Resolution|WORKSFORME                  |---

--- Comment #3 from Nick Treleaven <nick at geany.org> ---
(In reply to Andrej Mitrovic from comment #2)
> The diagnostic in 2.063.2 is now:
> 
> > Error: struct foo.X member s is not accessible

Can't reproduce that with v2.100.2-beta.1-dirty:

privaliasthis.d(6): Error: no property `func` for type `foo.X`

> perhaps the public alias to a private symbol should be disallowed in the first place.

I think a warning for that is needed, because people might not always test
their type outside the module it's defined in.

--


More information about the Digitalmars-d-bugs mailing list