%module template_default_inherit %warnfilter(SWIGWARN_RUBY_WRONG_NAME) A::nindex; /* Ruby, wrong constant name */ %inline %{ template struct A { typedef unsigned int size_type; static const size_type nindex = static_cast(-1); }; template struct B : A { typedef typename A::size_type size_type; void say_hi(size_type index = A::nindex) {} }; %} %template(A_int) A; %template(B_int) B;