mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
compiler: unsigned number properly printed and converted to string
fix: array accessing now works with unsigned numbers
This commit is contained in:
committed by
Alexander Medvednikov
parent
92cb199e8c
commit
872aa536d8
@@ -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')
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user