Closed ffleurey closed 7 years ago
Actually, the checker is not responsible. The problem is in the C compiler, where context.getConcreteThing()
returns null
...
public void generate(FunctionCallExpression expression, StringBuilder builder, Context ctx) {
CCompilerContext context = (CCompilerContext) ctx;
builder.append(context.getCName(expression.getFunction(), context.getConcreteThing()));
builder.append("(_instance");
for (Expression p : expression.getParameters()) {
builder.append(", ");
generate(p, builder, context);
}
builder.append(")");
}
The dirty hack is:
//FIXME: @ffleurey, @Lyadis this is a dirty hack... I get we should set the concreteThing in the context somewhere before...
Thing concreteThing = context.getConcreteThing();
if (concreteThing == null) {
concreteThing = (Thing) expression.getFunction().eContainer();
}
Seems like @Lyadis 's fix works 👍
Seem to be be not understood properly by the checker (ClassCastException suspected)