From 46beca5bed8a7700b18100fe48a78373be5055f9 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 10 Dec 2018 13:46:03 -0200 Subject: Better error messages for some polymorphic functions New auxiliary functions/macros 'luaL_argexpected'/'luaL_typeerror' ease the creation of error messages such as bad argument #2 to 'setmetatable' (nil or table expected, got boolean) (The novelty being the "got boolean" part...) --- lcorolib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lcorolib.c') diff --git a/lcorolib.c b/lcorolib.c index 9038f9fb..34462b53 100644 --- a/lcorolib.c +++ b/lcorolib.c @@ -20,7 +20,7 @@ static lua_State *getco (lua_State *L) { lua_State *co = lua_tothread(L, 1); - luaL_argcheck(L, co, 1, "thread expected"); + luaL_argexpected(L, co, 1, "thread"); return co; } -- cgit v1.2.1