Add test case to demonstrate the name collision that occurs in the generated C# code when a namespace is named System.
This commit is contained in:
parent
72afb74f47
commit
0f1e73fd26
2 changed files with 40 additions and 0 deletions
|
|
@ -17,6 +17,7 @@ CPP_TEST_CASES = \
|
|||
csharp_exceptions \
|
||||
csharp_features \
|
||||
csharp_lib_arrays \
|
||||
csharp_namespace_system_collision \
|
||||
csharp_prepost \
|
||||
csharp_typemaps \
|
||||
enum_thorough_simple \
|
||||
|
|
|
|||
39
Examples/test-suite/csharp_namespace_system_collision.i
Normal file
39
Examples/test-suite/csharp_namespace_system_collision.i
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
%module namespace_system_collision
|
||||
|
||||
%{
|
||||
#include <string>
|
||||
|
||||
namespace TopLevel
|
||||
{
|
||||
namespace System
|
||||
{
|
||||
class Foo {
|
||||
public:
|
||||
virtual ~Foo() {}
|
||||
virtual std::string ping() { return "TopLevel::System::Foo::ping()"; }
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
%include <std_string.i>
|
||||
|
||||
// nspace feature only supported by these languages
|
||||
#if defined(SWIGJAVA) || defined(SWIGCSHARP) || defined(SWIGD)
|
||||
%nspace;
|
||||
#else
|
||||
#warning nspace feature not yet supported in this target language
|
||||
#endif
|
||||
|
||||
namespace TopLevel
|
||||
{
|
||||
namespace System
|
||||
{
|
||||
class Foo {
|
||||
public:
|
||||
virtual ~Foo();
|
||||
virtual std::string ping();
|
||||
};
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue