%module xx struct Low : High { }; struct Small; struct Big : Small { }; %inline %{ namespace A { class XYZ {}; template struct ABC : public B::ABC { }; } namespace B { template struct ABC { void aaa(T t) {} }; } %} %template(ABCXYZ) A::ABC; %template() B::ABC; %template(ABCint) A::ABC; template struct Another : WrongOrderBase { }; %template(AnotherBool) Another; template class WrongOrderBase {}; %template(ForAnotherInt) WrongOrderBase;