From 09ba220e6240f99e2f93fb9a0694d802d664863b Mon Sep 17 00:00:00 2001 From: looki Date: Fri, 12 Aug 2016 04:33:26 +0200 Subject: [PATCH] Fix 'expected .. received ..' message for function arguments --- single/sol/sol.hpp | 8 ++++---- sol/stack_check.hpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/single/sol/sol.hpp b/single/sol/sol.hpp index 801ef906..6451fbfa 100644 --- a/single/sol/sol.hpp +++ b/single/sol/sol.hpp @@ -4607,7 +4607,7 @@ namespace sol { return true; } if (t != type::userdata && t != type::table) { - handler(L, index, t, type::function); + handler(L, index, type::function, t); return false; } // Do advanced check for call-style userdata? @@ -4615,13 +4615,13 @@ namespace sol { lua_getmetatable(L, index); if (lua_isnoneornil(L, -1)) { lua_pop(L, 1); - handler(L, index, t, type::function); + handler(L, index, type::function, t); return false; } lua_getfield(L, -1, &callkey[0]); if (lua_isnoneornil(L, -1)) { lua_pop(L, 2); - handler(L, index, t, type::function); + handler(L, index, type::function, t); return false; } // has call, is definitely a function @@ -4640,7 +4640,7 @@ namespace sol { return true; } if (t != type::userdata) { - handler(L, index, t, type::function); + handler(L, index, type::function, t); return false; } return true; diff --git a/sol/stack_check.hpp b/sol/stack_check.hpp index cde6facd..0b2b277e 100644 --- a/sol/stack_check.hpp +++ b/sol/stack_check.hpp @@ -194,7 +194,7 @@ namespace sol { return true; } if (t != type::userdata && t != type::table) { - handler(L, index, t, type::function); + handler(L, index, type::function, t); return false; } // Do advanced check for call-style userdata? @@ -202,13 +202,13 @@ namespace sol { lua_getmetatable(L, index); if (lua_isnoneornil(L, -1)) { lua_pop(L, 1); - handler(L, index, t, type::function); + handler(L, index, type::function, t); return false; } lua_getfield(L, -1, &callkey[0]); if (lua_isnoneornil(L, -1)) { lua_pop(L, 2); - handler(L, index, t, type::function); + handler(L, index, type::function, t); return false; } // has call, is definitely a function @@ -227,7 +227,7 @@ namespace sol { return true; } if (t != type::userdata) { - handler(L, index, t, type::function); + handler(L, index, type::function, t); return false; } return true;