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

parser: do not allow str[i++]; update contributing.md

This commit is contained in:
Alexander Medvednikov
2019-10-15 11:02:30 +03:00
parent bb1eca3564
commit 49d6c26da4
2 changed files with 5 additions and 4 deletions

View File

@ -2324,7 +2324,7 @@ fn (p mut Parser) index_expr(typ_ string, fn_ph int) string {
p.gen(',')
}
// expression inside [ ]
if is_arr {
if is_arr || is_str {
index_pos := p.cgen.cur_line.len
T := p.table.find_type(p.expression())
// Allows only i8-64 and byte-64 to be used when accessing an array