When compiling:
struct vec2 {
union {
float[2] cell;
struct {
union { float x; float r; }
union { float y; float g; }
}
}
const static vec2 zero = { x : 0f, y : 0f };
}
class HBoxLayout {
vec2 padding = vec2.zero;
}
class HBox {
HBoxLayout layout;
this() {
this.layout = new HBoxLayout;
}
}
On linux x86-64 using:
LLVM D Compiler rev. 1255:9014d7f0433f (2009-04-22 03:08 +0200)
based on DMD v1.042 and llvm 2.5 (2009-03-03 04:36:03 +0000)
I get the following assertion:
ldc: /home/robert/d/comp/ldc/ir/irclass.cpp:280: llvm::Constant* IrStruct::createClassDefaultInitializer(): Assertion `definit->getType() == type->irtype->getPA().get() && "class initializer type mismatch"' failed.
0 ldc 0x0000000000cecdd1
1 libc.so.6 0x00007f71bce74150
2 libc.so.6 0x00007f71bce740c5 gsignal + 53
3 libc.so.6 0x00007f71bce755e3 abort + 387
4 libc.so.6 0x00007f71bce6d0e9 __assert_fail + 233
5 ldc 0x0000000000665d20 IrStruct::createClassDefaultInitializer() + 816
6 ldc 0x0000000000672a05 IrStruct::getDefaultInit() + 37
7 ldc 0x0000000000608d7f DtoResolveClass(ClassDeclaration*) + 655
8 ldc 0x000000000065e7e1 Module::genLLVMModule(Ir*) + 609
9 ldc 0x000000000062396b main + 4891
10 libc.so.6 0x00007f71bce60546 __libc_start_main + 230
11 ldc 0x0000000000546e39