mirror of
https://github.com/vlang/v.git
synced 2025-09-14 23:12:33 +03:00
compiler: unsigned number properly printed and converted to string
fix: array accessing now works with unsigned numbers
This commit is contained in:
parent
92cb199e8c
commit
872aa536d8
4 changed files with 85 additions and 6 deletions
|
@ -1962,7 +1962,8 @@ fn (p mut Parser) index_expr(typ_ string, fn_ph int) string {
|
|||
// expression inside [ ]
|
||||
if is_arr {
|
||||
T := p.table.find_type(p.expression())
|
||||
if T.parent != 'int' {
|
||||
// Allows only i8-64 and u8-64 to be used when accessing an array
|
||||
if T.parent != 'int' && T.parent != 'u32' {
|
||||
p.check_types(T.name, 'int')
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue