News for hackers. Stuff that matters.
Re:V Language Review by delian66 on Sunday June 19, 2022 @05:24AM (#31797693)
> Bounds checking

    fn main() {
        x := []&int { len: 10, cap: 0 }
        println(x[4])
    }
Again, a bug caused by the auto generated string conversion method for arrays of pointers, that does not check for nil pointers. Once https://github.com/vlang/v/issues/14786 is fixed, that will work too.

It has nothing to do with bounds checking, as you can see if you just use `x := []int { len: 10, cap: 0 }` instead.

> Allowing the user to control the len property is a really bad idea.

Can you clarify what you mean by that?

There are no comments on this comment yet.