opendlang / opend

Boost Software License 1.0
89 stars 20 forks source link

`@implicit this` causes another crash #82

Closed GrimMaple closed 2 weeks ago

GrimMaple commented 2 weeks ago

The following code leads to a compiler crash

struct A
{
    @implicit this(string t) { }
}
unittest
{
    void foo(A a) { }
    foo("test");
}

Crash:

Assertion failed: isIrVarCreated(vd) && "Variable not resolved.", file D:\a\opend\opend\ldc\gen\llvmhelpers.cpp, line 1937
Exception Code: 0xC000001D
adamdruppe commented 2 weeks ago

this is ldc-specific, works in dmd. prolly missed a function call in the glue or in the frontend semantic

adamdruppe commented 2 weeks ago

found the problem, it declared the variable but didn't pass that declaration up the ast chain so ldc never allocated it (whereas dmd just magically did)

fix will go up in the next push

adamdruppe commented 2 weeks ago

this should be fixed in the latest build

GrimMaple commented 2 weeks ago

Confirmed working