public static TypeReference Combine(Ctx ctx, TypeReference a, TypeReference b) { if (a.IsSame(b)) { return a; } var t = Tuple.Create(a, b); if (t.Perms((x, y) => x.IsBoolean() && y.IsInt32())) { return ctx.Boolean; } return ctx.Object; }
private Expr InsertConvIfRequired(Expr expr, TypeReference requiredType) { if (requiredType.IsSame(expr.Type)) { return expr; } if (!requiredType.IsNumeric() || !expr.Type.IsNumeric()) { return expr; } var conv = new ExprConv(this.ctx, expr, requiredType, false); return conv; }