mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
array: fix a regression
This commit is contained in:
parent
570a7aaaf3
commit
dd12a85429
@ -195,12 +195,12 @@ fn (p mut Parser) index_get(typ string, fn_ph int, cfg IndexConfig) {
|
||||
p.gen('$index_expr ]')
|
||||
}
|
||||
else {
|
||||
amp := if cfg.is_ptr { '&' } else { '' }
|
||||
ref := if cfg.is_ptr { '*' } else { '' }
|
||||
if cfg.is_slice {
|
||||
p.gen(' array_slice($amp $index_expr) ')
|
||||
p.gen(' array_slice($ref $index_expr) ')
|
||||
}
|
||||
else {
|
||||
p.gen('( *($typ*) array_get($amp $index_expr) )')
|
||||
p.gen('( *($typ*) array_get($ref $index_expr) )')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user