You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{anything} should probably be "new", which will specifically block its creation and give a proper warning if someone calls new (otherwise it will just give a nil value error)
The errors that actually occur:
-------------------------------------------------------------------------------
no_constructor usage
regular method 1
-------------------------------------------------------------------------------
..\no_constructor.cpp(11)
...............................................................................
..\no_constructor.cpp(16): FAILED:
REQUIRE_NOTHROW( lua.script("a = thing.new()") )
due to unexpected exception with message:
lua: error: caught (...) exception
-------------------------------------------------------------------------------
no_constructor usage
regular method 2
-------------------------------------------------------------------------------
..\no_constructor.cpp(19)
...............................................................................
..\no_constructor.cpp(24): FAILED:
REQUIRE_NOTHROW( lua.script("a = thing.new()") )
due to unexpected exception with message:
lua: error: caught (...) exception
-------------------------------------------------------------------------------
no_constructor usage
simple method 1
-------------------------------------------------------------------------------
..\no_constructor.cpp(27)
...............................................................................
..\no_constructor.cpp(32): FAILED:
REQUIRE_NOTHROW( lua.script("a = thing.new()") )
due to unexpected exception with message:
lua: error: [string "a = thing.new()"]:1: attempt to call field 'new' (a
userdata value)
-------------------------------------------------------------------------------
no_constructor usage
simple method 2
-------------------------------------------------------------------------------
..\no_constructor.cpp(35)
...............................................................................
..\no_constructor.cpp(40): FAILED:
REQUIRE_NOTHROW( lua.script("a = thing.new()") )
due to unexpected exception with message:
lua: error: [string "a = thing.new()"]:1: attempt to call field 'new' (a
userdata value)
The test case (note: will fail even with proper error messages, this is just to see what the error messages look like; the test will need to look different to test that the errors are correct):
I get proper errors for the first 2, but not the second 2. I'll fix that and update the docs.
I don't know why you're getting a lua: error: caught (...) exception. It sounds like you might be using LuaJIT, and the trampoline might be gagging the real error.
Thanks for the fix, I'm still getting the ... exception for regular usertypes for some reason. I'm using standard Lua 5.1.5 compiled as C++ with SOL_USING_CXX_LUA and the MSVC14 compiler. If you'd like to investigate why that is happening any further, then let me know if there's any information you need from me.
From the docs:
The errors that actually occur:
The test case (note: will fail even with proper error messages, this is just to see what the error messages look like; the test will need to look different to test that the errors are correct):
The text was updated successfully, but these errors were encountered: