ldc-developers/ldc — Issue #53: Assertion `!isaStruct(t)`
Author: dsimcha
Created: 2011-12-18 16:12:46+00:00
State: open

// gtkwrapper.d
module plot2kill.gtkwrapper;

import std.conv;
import plot2kill.figure;

class FigureBase { }

class MenuItem {
this(void delegate(MenuItem) dg, string s) {}
}

class DefaultPlotWindow {
void buildRightClickMenu() {
new MenuItem(&popupTickDialog!'y', "_Y Ticks...");
}

void popupTickDialog(char xy)(MenuItem menuItem) {
double[] locations;
try locations = to!(double[])(["1.0"]);
catch(Exception) {}
}
}

// figure.d:
module plot2kill.figure;

public import plot2kill.gtkwrapper;
class Figure : FigureBase {}

dsimcha@debian:~/dustmitePlot2kill/plot2kill$ ldc2 -c -O3 figure.d -I..
ldc2: /home/dsimcha/ldcStuff/ldc/gen/tollvm.cpp:656: llvm::Value* DtoBitCast(llvm::Value*, llvm::Type*, const char*): Assertion `!isaStruct(t)' failed.
0 ldc2 0x000000000100a78f
1 ldc2 0x000000000100ac79
2 libpthread.so.0 0x00007f805f88e020
3 libc.so.6 0x00007f805e976405 gsignal + 53
4 libc.so.6 0x00007f805e979680 abort + 384
5 libc.so.6 0x00007f805e96f5b1 __assert_fail + 241
6 ldc2 0x0000000000722e6d
7 ldc2 0x00000000006ad108
8 ldc2 0x00000000006af32d DtoCallFunction(Loc&, Type*, DValue*, ArrayBase*) + 3469
9 ldc2 0x00000000006d736c CallExp::toElem(IRState*) + 412
10 ldc2 0x00000000007020a7 DtoArgument(Parameter*, Expression*) + 71
11 ldc2 0x00000000006af1dd DtoCallFunction(Loc&, Type*, DValue*, ArrayBase*) + 3133
12 ldc2 0x00000000006f7c4b DtoNewClass(Loc, TypeClass*, NewExp*) + 491
13 ldc2 0x00000000006da4a8 NewExp::toElem(IRState*) + 1096
14 ldc2 0x00000000006d3504 Expression::toElemDtor(IRState*) + 68
15 ldc2 0x00000000007285c8 ReturnStatement::toIR(IRState*) + 1016
16 ldc2 0x000000000072819e CompoundStatement::toIR(IRState*) + 94
Aborted