On Thursday, 5 January 2023 at 13:27:23 UTC, Vijay Nayar wrote:
Why is this error only found when declaring a class in the unittest?
A unittest is just a special function, it can run code and have local variables.
classes and structs declared inside it have access to those local contexts, which it calls the outer function context.
Make the outer class `static` too to lift it out of this and your error should go away.