lua-users home
lua-l archive

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


I tried those two lines and got the exact same error.

I'm using lua source 5.1.4

and latest bit op (source) version 1.0.1

i am compiling with visual studio 2008.

I was sure to add the two chunks of code in the install part of the website and recompiled several times.

the first couple of asserts work in the test code but the pcall's do not.

i use pcall from c in other parts of code and it works fine.

On Tue, Oct 5, 2010 at 2:42 AM, Mike Pall <mikelu-1010@mike.de> wrote:
Joe Andresen wrote:
> anyone else get this using the source?
>
> bad argument #1 to '?' (number expected, got no value)
>
> line 22 of the test file:
>
> if pcall(f) or pcall(f, "z") or pcall(f, true) then
>
> where f is the function "tobit"

This shouldn't happen. This test is checking proper error
handling. So it does throw an error, but pcall ought to catch it
silently.

Try the following test:

 pcall(error, "test")

This should give no error and no output. Similarly:

 local bit = require("bit")
 pcall(bit.tobit)

This should give no error and no output, too.

If any of the two tests fail, then your Lua VM has broken error
handling. Have you compiled Lua yourself or where have you
obtained a binary of it? Which version of Lua? Compiled with which
compiler version and running on which operating system?

--Mike