I'm trying to use the LuaD library right now... unfortunately, I've run into somewhat of a roadblock.

This doesn't work (assertion failure in dmd's backend/cgcs.c:351, which has apparently something to do with bitops... there's an assert(0) there and I'm not really sure why).

  import luad.all;

  struct Position {
        double x,y;
  }

  void main() {
        auto state = new LuaState;
        state.doString("pos = {x = 1, y = 2}");
        auto pos = state.get!Position("pos");
  }

but this does (note that state.get!(...) simply delegates to state.globals.get!(...)).

import luad.all;

struct Position {
        double x,y;
}

void main() {
        auto state = new LuaState;
        state.doString("pos = {x = 1, y = 2}");
        auto pos = state.get!Position("pos");
}

I'm not sure what's the cause and I don't know enough about dmd's internals to make an educated guess, but I'm pretty sure this is a bug in dmd and not in LuaD.

Reply via email to