diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index 59b7cafcda..7877b3e119 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -623,7 +623,7 @@ pub fn (mut c Checker) infix_expr(mut node ast.InfixExpr) ast.Type { node.left_type = map_info.key_type } else { - c.error('`$node.op.str()` can only be used with an array/map/string', + c.error('`$node.op.str()` can only be used with arrays and maps', node.pos) } } diff --git a/vlib/v/checker/tests/in_mismatch_type.out b/vlib/v/checker/tests/in_mismatch_type.out index 1a3b16c491..5a9c0a3bb9 100644 --- a/vlib/v/checker/tests/in_mismatch_type.out +++ b/vlib/v/checker/tests/in_mismatch_type.out @@ -12,21 +12,21 @@ vlib/v/checker/tests/in_mismatch_type.vv:13:5: error: left operand to `in` does | ~~~~~~ 14 | println('yeah') 15 | } -vlib/v/checker/tests/in_mismatch_type.vv:16:7: error: `in` can only be used with an array/map/string +vlib/v/checker/tests/in_mismatch_type.vv:16:7: error: `in` can only be used with arrays and maps 14 | println('yeah') 15 | } 16 | if 3 in s { | ~~ 17 | println('dope') 18 | } -vlib/v/checker/tests/in_mismatch_type.vv:19:9: error: `in` can only be used with an array/map/string +vlib/v/checker/tests/in_mismatch_type.vv:19:9: error: `in` can only be used with arrays and maps 17 | println('dope') 18 | } 19 | if `a` in s { | ~~ 20 | println("oh no :'(") 21 | } -vlib/v/checker/tests/in_mismatch_type.vv:22:7: error: `in` can only be used with an array/map/string +vlib/v/checker/tests/in_mismatch_type.vv:22:7: error: `in` can only be used with arrays and maps 20 | println("oh no :'(") 21 | } 22 | if 1 in 12 { @@ -70,8 +70,8 @@ vlib/v/checker/tests/in_mismatch_type.vv:37:5: error: left operand to `!in` does 39 | } vlib/v/checker/tests/in_mismatch_type.vv:41:5: error: left operand to `!in` does not match the map key type: expected `string`, not `int literal` 39 | } - 40 | + 40 | 41 | if 5 !in m { | ~~~~~~~ 42 | println('yay') - 43 | } \ No newline at end of file + 43 | }