usize indexing only

This commit is contained in:
2026-08-11 20:12:12 +02:00
parent fa53ca2219
commit c2343b54bb
8 changed files with 216 additions and 53 deletions
+2 -2
View File
@@ -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,6 +1,6 @@
main func() i32 {
items [3]mut i32 := undefined
i int := 1
i u32 := 1
items[i] = 42
return 0
}
+1 -1
View File
@@ -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