1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

require ++ instead of += 1

This commit is contained in:
Alexander Medvednikov
2019-12-08 14:11:19 +03:00
parent 8bc94947e5
commit cc682eafe1
4 changed files with 11 additions and 8 deletions

View File

@ -1385,6 +1385,10 @@ fn ($v.name mut $v.typ) $p.cur_fn.name (...) {
p.gen('= ustring_add($v.name, ')
}
else {
next := p.peek_token()
if next.tok == .number && next.lit== '1' {
p.warn('use ++ instead of += 1')
}
p.gen(' += ')
}
}