Skip to content

Commit ab83eac

Browse files
deadlocklogicThePhD
authored andcommitted
call.hpp: std::is_base_of_v<Union, Union> is false, use is_same_v
1 parent 980bc91 commit ab83eac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/sol/call.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ namespace sol {
478478
using object_type = typename wrap::object_type;
479479
if constexpr (sizeof...(Args) < 1) {
480480
using Ta = meta::conditional_t<std::is_void_v<T>, object_type, T>;
481-
static_assert(std::is_base_of_v<object_type, Ta>,
481+
static_assert(std::is_same_v<object_type, Ta> || std::is_base_of_v<object_type, Ta>,
482482
"It seems like you might have accidentally bound a class type with a member function method that does not correspond to the "
483483
"class. For example, there could be a small type in your new_usertype<T>(...) binding, where you specify one class \"T\" "
484484
"but then bind member methods from a complete unrelated class. Check things over!");
@@ -511,7 +511,7 @@ namespace sol {
511511
if constexpr (is_index) {
512512
if constexpr (sizeof...(Args) < 1) {
513513
using Ta = meta::conditional_t<std::is_void_v<T>, object_type, T>;
514-
static_assert(std::is_base_of_v<object_type, Ta>,
514+
static_assert(std::is_same_v<object_type, Ta> || std::is_base_of_v<object_type, Ta>,
515515
"It seems like you might have accidentally bound a class type with a member function method that does not correspond "
516516
"to the class. For example, there could be a small type in your new_usertype<T>(...) binding, where you specify one "
517517
"class \"T\" but then bind member methods from a complete unrelated class. Check things over!");

0 commit comments

Comments
 (0)