Open joroKr21 opened 2 months ago
I agree. It's checked everywhere, even with tail in terms of drop in terms of slice, where slice is forgiving about index out of bounds.
We'd have noticed this sooner, if only we used more strings when coding.
fyi @scala/collections
We have a PR! My idea was to have a scalacheck that checks uniformity of behavior of collections API. That is in lieu of touching collection-laws, which I looked at again. The idea is merely to verify that init
has uniform behavior (and throws the same exception, for example) with a model or prototype collection, such as List
. Maybe there is a prototype for Seq
, Set
, Map
, and mutable
vs immutable
.
Reproduction steps
Scala version: 2.13.14
Problem
I guess I expected them to be consistent with other collections and throw when empty.