jeremyong/Selene

Unable to call obj functions with std::string arguments

madeso opened this issue · 1 comments

bool getdog(const std::string& dog);
getdog("dog") // works

int Foo::DoubleAdd(int y);
foo.double_add(3) // works

void Obj::faildog(const std::string& dog);
obj:faildog("dog") // C++ argument is dog "\x5\x1", expected a lua error
obj.faildog("dog") // [string "obj.faildog("dog")"]:1: bad argument #1 to 'faildog' (unregistered type expected, got string)

Visual Studio 2015 on windows + lua 5.3.2, if it matters

Full test sample:
https://github.com/madeso/selene-test/blob/master/test_obj.cc

replace
void Obj::faildog(const std::string& dog);
with
void Obj::faildog(std::string dog);