Closed deadlocklogic closed 12 months ago
This is fixed in the latest commit, https://github.com/ThePhD/sol2/commit/ff3f254f7b47cfc8cf2976368d86f4cd726915ec
@ThePhD Hi,
I pulled the repo to the latest, still getting the same issue: stack index 1, expected anything, received nil
.
Thanks, I appreciate your efforts for bringing this nice library.
@deadlocklogic did you try this fix?
Apparently I was linking against the vcpkg
library instead of the main repo.
Indeed the issue is fixed.
Apologies.
@deadlocklogic did you try https://github.com/ThePhD/sol2/issues/1344#issuecomment-1624548126 fix?
This fix is peculiar since it silences critical sections.
lua["test1"] = { std::cout << "ok1" << std::endl; }; lua["test2"] = [](sol::object, sol::object) { std::cout << "ok2" << std::endl; }; lua.script("test1(nil)", [](lua_State, sol::protected_function_result pfr) { sol::error err = pfr; std::cout << err.what() << std::endl; return pfr; }); lua.script("test2(nil, nil)", [](lua_State, sol::protected_function_result pfr) { sol::error err = pfr; std::cout << err.what() << std::endl; return pfr; });
stack index 1, expected anything, received nil: stack traceback: [C]: in function 'test1' [string "test1(nil)"]:1: in main chunk stack index 1, expected anything, received nil: stack traceback: [C]: in function 'test2' [string "test2(nil, nil)"]:1: in main chunk