error : outer function context of `D main` is needed to `new` nested class `main.main.X`

Adam D. Ruppe destructionator at gmail.com
Thu Aug 15 02:23:06 UTC 2019


On Thursday, 15 August 2019 at 01:55:17 UTC, Bert wrote:
> void main()
> {
>     class X { ... }

I would just make it `static class X` and then it shoudl work 
fine.

Won't be able to access main's local variables then though, but 
you could pass the necessary ones through the constructors or 
something.



More information about the Digitalmars-d-learn mailing list