%module template_enum_ns_inherit %inline %{ namespace oss { enum Polarization { UnaryPolarization, BinaryPolarization }; template struct Interface { }; template struct Module { }; } %} namespace oss { %template(Interface_UP) Interface; %template(Module_UPIUP) Module >; } %inline %{ namespace oss { namespace hello { struct HInterface1 : Interface // this works (with fullns qualification) { }; struct HInterface2 : Interface // this doesn't work { }; struct HModule1 : Module > { }; } } %}