From 695de9ee0e748347985a470f193c07f3320a2b58 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 19 Apr 2013 22:34:59 +0100 Subject: [PATCH] Tcl: change differently named constructors behaviour. Where overloaded constructors are given different names, a class is constructed by calling the name of the first constructor wrapper parsed rather than the last one parsed. Behaviour is not perfect as either name could be used, it is just consistent with Python. Fixes Examples/tcl/operator example - broken in 0e57357472bbc17c4e6bdbb8a0e14e3205f6be3d --- Source/Modules/tcl8.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Modules/tcl8.cxx b/Source/Modules/tcl8.cxx index 9ef1b8706..e61071167 100644 --- a/Source/Modules/tcl8.cxx +++ b/Source/Modules/tcl8.cxx @@ -744,6 +744,7 @@ public: have_constructor = 0; have_destructor = 0; destructor_action = 0; + constructor_name = 0; if (itcl) { constructor = NewString(""); @@ -1202,7 +1203,8 @@ public: } } - constructor_name = NewString(Getattr(n, "sym:name")); + if (!have_constructor) + constructor_name = NewString(Getattr(n, "sym:name")); have_constructor = 1; return SWIG_OK; }