tomaka / hlua

Rust library to interface with Lua
MIT License
507 stars 48 forks source link

Why does implement_lua_read!(...) not implement everything you need? #75

Closed CryZe closed 7 years ago

CryZe commented 8 years ago

If you want to have functions that take 2 or more parameters with one of them being a user data type, it won't work as the impls for it are missing, so you need to write additional impls: http://puu.sh/oSHM3.png

This seems weird. Am I missing something or why is this the case?

Looks like this doesn't even work, so I don't know what to do now :/

This is the error I'm getting: http://puu.sh/oSInR.png

tomaka commented 8 years ago

This macro was hastily written and is not unit-tested at all. This may be a legitimate mistake.

CryZe commented 8 years ago

Is there a way for me to fix this? I can't really use this crate if I can't use any methods that have any parameter other than self.

CryZe commented 8 years ago

Looks like the index parameter provided is -2, which fails the assertion in userdata::read_userdata

CryZe commented 8 years ago

The argument count of 2 causes the index to be -2 http://puu.sh/oTSAv.png