Skip to content

SortedSet.collect does not accept a function for which there is no Ordering on the codomain #11019

Closed
@MasseGuillaume

Description

@MasseGuillaume

2.12

case class A(v: Int)
collection.immutable.SortedSet(1).collect{ case x => A(x) }
// collection.immutable.Set[A] = Set(A(1))

2.13

[error] /home/gui/scala/test/junit/scala/Playground.scala:12: No implicit Ordering defined for A.
[error]     collection.immutable.SortedSet(1).collect{ case x => A(x) }
[error]                                              ^

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions