Given the input:
#ifdef SWIG
%ignore A::Class;
#endif
namespace A {
template <class TYPE >
class Templated { };
class Class { };
}
namespace B {
class Class { };
A::Templated< Class > test1() {}
}
`./swig -csharp -c++ -module testing testing2.cpp` produces:
SWIGEXPORT void * SWIGSTDCALL CSharp_test1() {
void * jresult ;
SwigValueWrapper< A::Templated< A::Class > > result;
result = B::test1();
jresult = new A::Templated< A::Class >((const A::Templated< A::Class > &)result);
return jresult;
}
Here, A::Class should be B::Class instead.
works-for-me patch
Reproducible with SWIG git master.
@wsfulton Does the suggested fix look plausible?
I've opened a PR with this patch to try to move things forwards: https://github.com/swig/swig/pull/2636