bad fallthrough, missed specialization

This commit is contained in:
ThePhD 2018-02-17 01:09:30 -05:00
parent 0192fcb176
commit 3ad438ac01
2 changed files with 7 additions and 2 deletions

View File

@ -313,14 +313,16 @@ namespace sol {
template <typename... Functions> template <typename... Functions>
struct pusher<overload_set<Functions...>> { struct pusher<overload_set<Functions...>> {
static int push(lua_State* L, overload_set<Functions...>&& set) { static int push(lua_State* L, overload_set<Functions...>&& set) {
// TODO: yielding
typedef function_detail::overloaded_function<0, Functions...> F; typedef function_detail::overloaded_function<0, Functions...> F;
pusher<function_sig<>>{}.set_fx<F>(L, std::move(set.functions)); pusher<function_sig<>>{}.set_fx<false, F>(L, std::move(set.functions));
return 1; return 1;
} }
static int push(lua_State* L, const overload_set<Functions...>& set) { static int push(lua_State* L, const overload_set<Functions...>& set) {
// TODO: yielding
typedef function_detail::overloaded_function<0, Functions...> F; typedef function_detail::overloaded_function<0, Functions...> F;
pusher<function_sig<>>{}.set_fx<F>(L, set.functions); pusher<function_sig<>>{}.set_fx<false, F>(L, set.functions);
return 1; return 1;
} }
}; };

View File

@ -104,10 +104,13 @@ namespace function_detail {
switch (lua_gettop(L)) { switch (lua_gettop(L)) {
case 0: case 0:
nr = call_detail::call_wrapped<T, true, false, -1>(L, var, mem); nr = call_detail::call_wrapped<T, true, false, -1>(L, var, mem);
break;
case 1: case 1:
nr = call_detail::call_wrapped<T, false, false, -1>(L, var, mem); nr = call_detail::call_wrapped<T, false, false, -1>(L, var, mem);
break;
default: default:
nr = luaL_error(L, "sol: incorrect number of arguments to member variable function"); nr = luaL_error(L, "sol: incorrect number of arguments to member variable function");
break;
} }
} }
if (is_yielding) { if (is_yielding) {