mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: update error message for if 'a' in 'abcd' {
This commit is contained in:
parent
ba9aad1d92
commit
57fa9768d5
@ -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)
|
||||
}
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user