From 63a5a8af88271559a7b170794b4c61c30b8934ea Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 6 Mar 2018 19:27:55 +0000 Subject: [PATCH] Fix lookup of csconstruct, dconstructor and javaconstruct typemaps The C++ namespace was previously ignored in the lookup type --- Source/Modules/csharp.cxx | 3 ++- Source/Modules/d.cxx | 3 ++- Source/Modules/java.cxx | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/Modules/csharp.cxx b/Source/Modules/csharp.cxx index 8bd25aa48..ff9c1ae8b 100644 --- a/Source/Modules/csharp.cxx +++ b/Source/Modules/csharp.cxx @@ -2788,7 +2788,8 @@ public: /* Insert the csconstruct typemap, doing the replacement for $directorconnect, as needed */ Hash *attributes = NewHash(); - String *construct_tm = Copy(typemapLookup(n, "csconstruct", Getattr(n, "name"), + String *typemap_lookup_type = Getattr(getCurrentClass(), "classtypeobj"); + String *construct_tm = Copy(typemapLookup(n, "csconstruct", typemap_lookup_type, WARN_CSHARP_TYPEMAP_CSCONSTRUCT_UNDEF, attributes)); if (construct_tm) { if (!feature_director) { diff --git a/Source/Modules/d.cxx b/Source/Modules/d.cxx index 0c3f020a8..d740f0a17 100644 --- a/Source/Modules/d.cxx +++ b/Source/Modules/d.cxx @@ -1227,8 +1227,9 @@ public: // Insert the dconstructor typemap (replacing $directorconnect as needed). Hash *attributes = NewHash(); + String *typemap_lookup_type = Getattr(getCurrentClass(), "classtypeobj"); String *construct_tm = Copy(lookupCodeTypemap(n, "dconstructor", - Getattr(n, "name"), WARN_D_TYPEMAP_DCONSTRUCTOR_UNDEF, attributes)); + typemap_lookup_type, WARN_D_TYPEMAP_DCONSTRUCTOR_UNDEF, attributes)); if (construct_tm) { const bool use_director = (parentNode(n) && Swig_directorclass(n)); if (!use_director) { diff --git a/Source/Modules/java.cxx b/Source/Modules/java.cxx index f89de4e12..2c42a01be 100644 --- a/Source/Modules/java.cxx +++ b/Source/Modules/java.cxx @@ -2767,7 +2767,8 @@ public: /* Insert the javaconstruct typemap, doing the replacement for $directorconnect, as needed */ Hash *attributes = NewHash(); - String *construct_tm = Copy(typemapLookup(n, "javaconstruct", Getattr(n, "name"), + String *typemap_lookup_type = Getattr(getCurrentClass(), "classtypeobj"); + String *construct_tm = Copy(typemapLookup(n, "javaconstruct", typemap_lookup_type, WARN_JAVA_TYPEMAP_JAVACONSTRUCT_UNDEF, attributes)); if (construct_tm) { if (!feature_director) {