LuaD icon indicating copy to clipboard operation
LuaD copied to clipboard

Bug in DMD 2.064 breaks LuaD

Open hanst99 opened this issue 11 years ago • 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.

hanst99 avatar Dec 26 '13 15:12 hanst99

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

JakobOvrum avatar Dec 27 '13 05:12 JakobOvrum

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.

JakobOvrum avatar Mar 14 '14 17:03 JakobOvrum

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.

hanst99 avatar Apr 18 '14 20:04 hanst99