On Sunday, December 03, 2017 01:05:00 Nick Sabalausky  via Digitalmars-d-
learn wrote:
> Is this even possible? My attempts:
>
> class Outer {
>   struct Inner {
>       void foo() {
>           // Error: no property 'outer' for type 'Inner'
>           Outer o = this.outer;
>
>           // Error: cannot implicitly convert expression
>           // this of type Inner to testNested.Outer
>           Outer o = this;
>       }
>   }
> }

As I understand it, there is no outer for nested structs, only nested
classes. So, you'll either have to use a nested class or explicitly pass a
reference to the outer class to the nested struct.

- Jonathan M Davis

Reply via email to