lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> > math.sin(setmetatable({},{__name = 'number'}))
> sandbox:1: bad argument #1 to 'sin' (number expected, got number)

So, don't use the name of a basic type as the name of your type...

> Could this be changed to something like:
> "bad argument #%d to '%s' (%s (%s) expected, got %s (%s))"
> where each first %s is the base type (as returned by lua_typename),
> and the %s in parenthesis is the __name metafield?

And then get this?
	bad argument #1 to 'sin' (number (number) expected, got number (number))