bug icon indicating copy to clipboard operation
bug copied to clipboard

HashMap toString doc is Any not Iterable

Open som-snytt opened this issue 8 months ago • 0 comments

Questions are not bug reports

This may be a queston?

Reproduction steps

Scala version: 2 & 3

scala> m.toString
val res2: String = HashMap(5 -> 6, 1 -> 2, 9 -> 10, 7 -> 8, 3 -> 4)

Problem

Explain how the above behavior isn't what you expected.

Doc for Map#toString shows doc for Any, not for Iterable. Same for all collection types extending Function, which has an override for toString.

Cf View#toString.

Maybe it's just a quirk of linearization, but it's clearly not something I should have to ponder.

som-snytt avatar Mar 31 '25 18:03 som-snytt