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
I imagine this might be another ambiguity-dilemma issue, but in my code I've got a D-side function that does some processing and then returns results filtered through a LuaFunction.
However, if I pass the return value from LuaFunction directly back to Lua, the values are packed in an array.
For the moment, I can add a wrapper function Lua-side to run unpack() first, but it seems a little bit wasteful to just unpack what D already spent memory packing; it'd be nice to have a way of doing this directly.
The text was updated successfully, but these errors were encountered:
...Oh, Duh! Sorry, I managed to completely overlook that. That's exactly what I want--Throwing it into my production code is triggering an ICE, but that's a problem to file with DMD.
Specifically, it seems like having a function that returns a LuaVariableReturn!(LuaObject[]), calling it from D code, and discarding the return value completely triggers an ICE, at least on DMD 2.065/Win32. Returning the contained LuaObject[] and discarding that is fine, though.
import luad.all;
static auto wrappedfunc (LuaFunction f, LuaObject[] args...) {
//ICE:
return f.call!(LuaVariableReturn!(LuaObject[]))(args);
//Works:
//return f.call!(LuaVariableReturn!(LuaObject[]))(args).returnValues;
}
void main() {
auto stat = new LuaState();
auto a = stat.loadString(`return nil`);
wrappedfunc(a);
}
I imagine this might be another ambiguity-dilemma issue, but in my code I've got a D-side function that does some processing and then returns results filtered through a LuaFunction.
However, if I pass the return value from LuaFunction directly back to Lua, the values are packed in an array.
For the moment, I can add a wrapper function Lua-side to run unpack() first, but it seems a little bit wasteful to just unpack what D already spent memory packing; it'd be nice to have a way of doing this directly.
The text was updated successfully, but these errors were encountered: