Skip to content
Browse files

Add test case to demonstrate the name collision that occurs in the ge…

…nerated C# code when a namespace is named System.
  • Loading branch information...
1 parent 72afb74 commit 0f1e73fd26238b1cb1515f8518393e8a4e0bd57d @BrantKyser BrantKyser committed Oct 15, 2013
Showing with 40 additions and 0 deletions.
  1. +1 −0 Examples/test-suite/csharp/Makefile.in
  2. +39 −0 Examples/test-suite/csharp_namespace_system_collision.i
View
1 Examples/test-suite/csharp/Makefile.in
@@ -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 \
View
39 Examples/test-suite/csharp_namespace_system_collision.i
@@ -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();
+ };
+ }
+}

0 comments on commit 0f1e73f

Please sign in to comment.
Something went wrong with that request. Please try again.