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 0e57357472
This commit is contained in:
William S Fulton 2013-04-19 22:34:59 +01:00
commit 695de9ee0e

View file

@ -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;
}