array: make .set() private + format
parent
29b4114bc0
commit
72363ada84
|
@ -311,7 +311,7 @@ fn (v mut V) compile() {
|
|||
d.writeln(v.prof_counters())
|
||||
}
|
||||
dd := d.str()
|
||||
cgen.lines.set(defs_pos, dd)// TODO `def.str()` doesn't compile
|
||||
cgen.lines[defs_pos] = dd// TODO `def.str()` doesn't compile
|
||||
|
||||
v.generate_main()
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ pub fn (s array) slice(start, _end int) array {
|
|||
return res
|
||||
}
|
||||
|
||||
pub fn (a mut array) set(idx int, val voidptr) {
|
||||
fn (a mut array) set(idx int, val voidptr) {
|
||||
if idx < 0 || idx >= a.len {
|
||||
panic('array index out of range: $idx / $a.len')
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue