-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No arg error thrown for bool stack get #82
Comments
Thanks for reporting, should be pretty trivial to fix. |
This poses a question, is LUA_TNIL castable to bool ? Much like how you would cast a pointer to bool to check its validity, this could be debatable. We might want a strict mode for Stack get, but this will also make it more complex. |
Hm, in such case I would always check what the default Lua behavior is. http://lua-users.org/wiki/ExpressionsTutorial |
My code expects absent bools (i.e., LUA_TNONE) to get passed into C++ as false. This is LB2 behavior, and it is standard Lua behavior. If you are going to implement a fix, I would request an opt-out. That said, I have one or two constructors where I would really like to be able to force the programmer to supply the boolean. But I can do that with a proxy constructor. |
Stack<bool>::get
does not check whether an actual value exists on stack. This results in LuaBridge silently treating ano value
as a valid bool and not throwing any error.See for example
Stack<float>
which has a check and reports if a non-float value (or no value) is on stack.The text was updated successfully, but these errors were encountered: