static GMQCC_INLINE ast_expression *fold_op_mul(fold_t *fold, ast_value *a, ast_value *b) {
if (isfloat(a)) {
- if (isfloat(b)) {
+ if (isvector(b)) {
if (fold_can_2(a, b))
return fold_constgen_vector(fold, vec3_mulvf(fold_immvalue_vector(b), fold_immvalue_float(a)));
} else {
case opid2('=','='): return fold_op_cmp (fold, a, b, false);
case opid2('~','P'): return fold_op_bnot (fold, a);
}
+ compile_error(fold_ctx(fold), "internal error: attempted to constant for unsupported operator");
return NULL;
}
if (exprs[0]->vtype != exprs[1]->vtype ||
(exprs[0]->vtype != TYPE_VECTOR && exprs[0]->vtype != TYPE_FLOAT) )
{
- compile_error(ctx, "invalid types used in expression: cannot add type %s and %s",
+ compile_error(ctx, "invalid types used in expression: cannot add type %s and %s (%s %s)",
type_name[exprs[0]->vtype],
- type_name[exprs[1]->vtype]);
+ type_name[exprs[1]->vtype],
+ asvalue[0]->name,
+ asvalue[1]->name);
return false;
}
if (!(out = fold_op(parser->fold, op, exprs))) {