aboutsummaryrefslogtreecommitdiff
path: root/lcorolib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-12-10 13:46:03 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-12-10 13:46:03 -0200
commit46beca5bed8a7700b18100fe48a78373be5055f9 (patch)
tree499de35c048605434d9adb7ace964adf673041ac /lcorolib.c
parent28d829c86712ce5bc453feccc5129a32f78d80c0 (diff)
downloadlua-46beca5bed8a7700b18100fe48a78373be5055f9.tar.gz
lua-46beca5bed8a7700b18100fe48a78373be5055f9.tar.bz2
lua-46beca5bed8a7700b18100fe48a78373be5055f9.zip
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...)
Diffstat (limited to 'lcorolib.c')
-rw-r--r--lcorolib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lcorolib.c b/lcorolib.c
index 9038f9fb..34462b53 100644
--- a/lcorolib.c
+++ b/lcorolib.c
@@ -20,7 +20,7 @@
20 20
21static lua_State *getco (lua_State *L) { 21static lua_State *getco (lua_State *L) {
22 lua_State *co = lua_tothread(L, 1); 22 lua_State *co = lua_tothread(L, 1);
23 luaL_argcheck(L, co, 1, "thread expected"); 23 luaL_argexpected(L, co, 1, "thread");
24 return co; 24 return co;
25} 25}
26 26