Skip to content

IndexedSeqOps.head = apply(0) throws IndexOutOfBoundsException, not NoSuchElementException #12782

Closed
scala/scala
#10392
@noresttherein

Description

Reproduction steps

Scala version: 2.13.10

Problem

Implementing IndexedSeq and not overriding head leads to an IOOBE being thrown, contrary to NSEE mentioned in the specification. This does not affect Vector, as it overrides head.
The same goes for last.

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions