On 2019-04-02 20:44, Q. Schroll wrote:

After removing the calls to writeln, the error I get is:

`this` for `read` needs to be type `Outer` not type `Inner`

You cannot access stuff in Outer because Inner objects are not outer objects and don't implicitly own an Outer object. In your Inner method `write`, there is no Outer object present at all to call the method on.

It works if the struct is nested inside a function [1]. I thought it would work nested inside a struct too.

[1] https://dlang.org/spec/struct.html#nested

--
/Jacob Carlborg

Reply via email to