Dear Rudolf,
thank you very much for your thoughts! Exactly this solution I already had in mind, but I did not test it because of the errors. It seems it is always worth trying :)
I understand that (when seeing a submodule as a member variable) in C++ this is not possible as well. But I cannot think of a situation where this could go wrong with a ned module. Your solution (that I tried for our usecase) demonstrates that it is (in general) possible.
Your solution for the problem does not work for all (and especially for our) situation. Think of someone extending a module of another framework. In our case we extend modules from INET. We cannot add an Interface to the existing module, though we cannot use the "<Module> like Interface" syntax. Also (in the cases where it is possible) it is very inconvenient to add Interfaces to all modules just to allow the syntax.
I would still love to see the possibility to overwrite (when I think about it it is more overloading) modules. Perhaps something like: "sub: <default("Submodule")> extends Submodule;" would be a possible way as well, but why not allow the definition of a module with the same name when it extends the overwritten module? Of cause it would require to collect the gate, connection and parameter definitions of the overwritten module as well.
I think such a possibility has the potential to save a lot of (ned)code that would be otherwise defined in several modules, and thus reduce the maintenance effort significantly.
I hope I'm not the only one who would require that feature :)
Best regards from Hamburg
Till