News for hackers. Stuff that matters.
Re:Things Go needs more than generics by CryZe on Monday October 04, 2021 @05:24AM (#28744717)
One issue I've noticed is that indexing into a T[] array where T can't be undefined, results in the expression to be of type T, not T | undefined, despite an out of bounds index evaluating to undefined. I believe I've seen that they recently added a setting that changes this though.
Re:Things Go needs more than generics by cageface on Monday October 04, 2021 @05:39AM (#28744790)
A lot of statically typed languages leave array indexing as a loophole for convenience but yeah this can also be a source of errors.