Fix broken type conversion call implementation

- We need to properly order the function so that the one with the least
   number if type differences is the one that is tried first.
This commit is contained in:
Jason Turner
2014-11-01 15:52:02 -06:00
parent e2cf8a48be
commit 87cee688a8
2 changed files with 34 additions and 24 deletions

View File

@@ -314,7 +314,7 @@ namespace chaiscript
protected:
virtual Boxed_Value do_call(const std::vector<Boxed_Value> &params, const Type_Conversions &t_conversions) const CHAISCRIPT_OVERRIDE
{
return dispatch::dispatch(m_funcs.cbegin(), m_funcs.cend(), params, t_conversions);
return dispatch::dispatch(m_funcs, params, t_conversions);
}
private:
@@ -775,9 +775,7 @@ namespace chaiscript
Boxed_Value call_function(const std::string &t_name, const std::vector<Boxed_Value> &params) const
{
std::vector<Proxy_Function> functions = get_function(t_name);
return dispatch::dispatch(functions.begin(), functions.end(), params, m_conversions);
return dispatch::dispatch(get_function(t_name), params, m_conversions);
}
Boxed_Value call_function(const std::string &t_name) const