Correct check for which types might have conversions

This commit is contained in:
Jason Turner 2014-10-29 07:07:12 -06:00
parent 7c766f87a4
commit e2cf8a48be

View File

@ -260,7 +260,7 @@ namespace chaiscript
bool converts(const Type_Info &to, const Type_Info &from) const
{
const auto &types = thread_cache();
if (types.count(to.bare_type_info()) != 0 && types.count(to.bare_type_info()) != 0)
if (types.count(to.bare_type_info()) != 0 && types.count(from.bare_type_info()) != 0)
{
return has_conversion(to, from) || has_conversion(from, to);
} else {