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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 24 19:42:14 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9809



--- Comment #1 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-03-24 19:42:13 PDT ---
(In reply to comment #0)
> struct X
> {
>     public alias s this;
>     private S s;
> }

Btw, the reason I needed this is because I want 's' fields/methods to be
accessible, but I do not want the user to be able to assign 's' to something
else.

Perhaps I should have used:

struct NoAssign
{
    @disable void opAssign(T...)(T t) { }
    S s;
    alias s this;
}

struct X
{
    alias s this;
    NoAssign s;
}

Not too sure..

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list