Aliases and permissions [was: Re: extern(C++, NS)]
Manu via Digitalmars-d
digitalmars-d at puremagic.com
Mon Nov 30 03:59:53 PST 2015
On 29 November 2015 at 22:58, Jonathan M Davis via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> On Sunday, 29 November 2015 at 12:39:14 UTC, Joseph Rushton Wakeling wrote:
>>
>> On Sunday, 29 November 2015 at 04:57:28 UTC, Walter Bright wrote:
>>>
>>> Aliases do not change access permissions. They are just aliases.
>>
>>
>> Note that this is a problem beyond Manu's use-case. Example: subtyping
>> via alias this currently requires the alias'd entity to be public, contra
>> the example given on TDPL p.231 (see
>> https://issues.dlang.org/show_bug.cgi?id=10996 for details).
>>
>> This means that to use subtyping in practice requires internal
>> implementation details to be revealed to the user, which isn't very nice :-(
>
>
> As long as aliases effectively disappear in the compiler once a replacement
> has been made, and they don't end up in error messages, allowing aliases to
> muck with anything about the original symbol seems like a recipe for
> disaster, though I can certainly see why folks would want it (and arguably,
> it would be a lot more user-friendly if the aliases showed up in the error
> messages along with the original symbol rather than outright disappearing).
>
> - Jonathan M Davis
This. This is my experience with aliases too. I have found
disappearance of aliases has been a source of confusion on numerous
occasions.
More information about the Digitalmars-d
mailing list