diff --git a/src/entt/meta/meta.hpp b/src/entt/meta/meta.hpp index 49efee058..bd59e9f9e 100644 --- a/src/entt/meta/meta.hpp +++ b/src/entt/meta/meta.hpp @@ -1528,6 +1528,10 @@ bool meta_any::set(const id_type id, Type &&value) { } if(const auto *value = data(); node.details) { + if(auto it = node.details->conv.find(type.info().hash()); it != node.details->conv.cend()) { + return it->second.conv(*ctx, data()); + } + for(auto &&curr: node.details->base) { const auto &as_const = curr.second.type(internal::meta_context::from(*ctx)).from_void(*ctx, nullptr, curr.second.cast(value)); @@ -1535,10 +1539,6 @@ bool meta_any::set(const id_type id, Type &&value) { return other; } } - - if(auto it = node.details->conv.find(type.info().hash()); it != node.details->conv.cend()) { - return it->second.conv(*ctx, data()); - } } if(node.conversion_helper && (type.is_arithmetic() || type.is_enum())) {