diff --git a/vlib/builtin/array.v b/vlib/builtin/array.v index eb95ad457d5759..44eddaf79a5257 100644 --- a/vlib/builtin/array.v +++ b/vlib/builtin/array.v @@ -563,13 +563,15 @@ fn (a array) slice(start int, _end int) array { end := if _end == max_int { a.len } else { _end } // max_int $if !no_bounds_checking { if start > end { - panic_n2('array.slice: invalid slice index (start>end):', start, end) + panic('array.slice: invalid slice index (start>end):' + i64(start).str() + ', ' + + i64(end).str()) } if end > a.len { - panic_n2('array.slice: slice bounds out of range (end>=a.len):', end, a.len) + panic('array.slice: slice bounds out of range (' + i64(end).str() + ' >= ' + + i64(a.len).str() + ')') } if start < 0 { - panic_n('array.slice: slice bounds out of range (start<0):', start) + panic('array.slice: slice bounds out of range (start<0):' + start.str()) } } // TODO: integrate reference counting diff --git a/vlib/builtin/builtin.c.v b/vlib/builtin/builtin.c.v index fa4cb5f9c1e94f..05e851f727445b 100644 --- a/vlib/builtin/builtin.c.v +++ b/vlib/builtin/builtin.c.v @@ -769,7 +769,8 @@ pub fn gc_memory_use() usize { fn v_fixed_index(i int, len int) int { $if !no_bounds_checking { if i < 0 || i >= len { - panic_n2('fixed array index out of range (index, len):', i, len) + panic('fixed array index out of range (index: ' + i64(i).str() + ', len: ' + + i64(len).str() + ')') } } return i