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) {