mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser: x in []
is always false
This commit is contained in:
parent
5a8c07dcf5
commit
cc834dd7a7
@ -6,6 +6,9 @@ module compiler
|
||||
// `ph` is for string_eq()
|
||||
fn (p mut Parser) in_optimization(typ string, ph int) {
|
||||
p.check(.lsbr)
|
||||
if p.tok == .rsbr {
|
||||
p.error('`x in []` is always false')
|
||||
}
|
||||
mut i := 0
|
||||
// Get `a` expr value (can be a string literal, not a variable)
|
||||
expr := p.cgen.cur_line[ph..]
|
||||
|
Loading…
Reference in New Issue
Block a user