JakobOvrum/LuaD

Bug in DMD 2.064 breaks LuaD

Opened this issue · 3 comments

This isn't your fault, but I think this should be posted here just in case anyone finds a workaround before the bug is fixed:

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");
}

will not compile (assertion failure in dmd's backend).

import luad.all;

struct Position {
    double x,y;
}

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

works.

import luad.all;
import std.stdio;

struct Position {
    double x,y;
}

Position getPos(LuaState state) {
    return state.globals.get!Position("pos");
}

void main() {
    LuaState state = new LuaState;
    state.doString("pos = {x = 1, y = 2}");
    writeln(getPos(state));
}

doesn't work. No, I don't get it either.

Thanks a bunch for filing this. I'll get to reducing your examples once I have time.

Sorry, I totally forgot about this. It works again in 2.065. I'm divided on whether supporting 2.064 is something I really want to do.

Of course I don't have any sort of authority on this, but considering this is a minor version upgrade I doubt anyone would have any trouble upgrading, so leaving it alone should be alright.