diff --git a/vlib/compiler/expression.v b/vlib/compiler/expression.v index 4ff7531caa..f0f37df7a4 100644 --- a/vlib/compiler/expression.v +++ b/vlib/compiler/expression.v @@ -437,9 +437,9 @@ fn (p mut Parser) expression() string { p.error('strings only support `+` operator') } expr_type := p.term() - if (tok_op in [.pipe, .amp]) && !(is_integer_type(expr_type) && + if (tok_op in [.pipe, .amp, .xor]) && !(is_integer_type(expr_type) && is_integer_type(typ)) { - p.error('operators `&` and `|` are defined only on integer types') + p.error('operator ${tok_op.str()} is defined only on integer types') } p.check_types(expr_type, typ) if (is_str || is_ustr) && tok_op == .plus && !p.is_js {