usize indexing only
This commit is contained in:
@@ -82,8 +82,8 @@ main func() i32 {
|
||||
if bits != 255 { return 10 }
|
||||
|
||||
values [10]u8 := [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||
if values[LocalID(4)] != 4 { return 11 }
|
||||
section []u8 := values[LocalID(2)..LocalID(5)]
|
||||
if values[usize(LocalID(4))] != 4 { return 11 }
|
||||
section []u8 := values[usize(LocalID(2))..usize(LocalID(5))]
|
||||
if section.len != 3 or section[usize(0)] != 2 or section[usize(2)] != 4 { return 12 }
|
||||
|
||||
if u32(id) != 7 or usize(id) != 7 or f64(id) != 7.0 { return 13 }
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
main func() i32 {
|
||||
items [3]mut i32 := undefined
|
||||
i int := 1
|
||||
i u32 := 1
|
||||
items[i] = 42
|
||||
return 0
|
||||
}
|
||||
@@ -52,7 +52,7 @@ main func() i32 {
|
||||
items[0] = 10
|
||||
items[1] = 20
|
||||
|
||||
idx u8 := 2
|
||||
idx usize := 2
|
||||
items[idx] = items[0] + items[1]
|
||||
if (items[2] != 30) return 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user