Using Clause for Inner Module?

I want to add a Using Clause to an inner module.

But doing so results in a “Members of inner modules cannot be global” compile error.

For example, I want module Module1.Inner_Module to “import” the members of another module Module2.

Is there a way to do this? Or is there a reason why this is impossible?

I guess you copied a global method / property or something like that into the inner module.
Methods and properties of inner modules can’t be global.
You have to set the scope of this method / property / … to protected and then you shouldn’t get this error anymore.

Thanks, but the compile error occurs even when then modules in question have no members whatsoever.

It would be really useful to be able to import members of some module module_1 into some nested module module_2.nested_module, even just protected members.

Is there any way to do this? If not is there a reason why it should be impossible?

This .xojo_binary project demonstrates the behaviour in question.

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.