Skip to content

compile error "diverging implicit expansion for type scala.math.Ordering ..." #8541

Open
@scabug

Description

@scabug
object Test2 {
   class TimeStamp(val toLong: Long) extends AnyVal with Ordered[TimeStamp] {
     def compare(that: TimeStamp) = java.lang.Long.compare(toLong, that.toLong)
   }

   // while looking irrelevant, these two code lines are needed to reproduce the bug
   case class L(time: TimeStamp)
   List.empty[L].sortBy(_.time)

   // this line triggers compiler error "diverging implicit expansion for type scala.math.Ordering[(Int, Test2.TimeStamp)] starting with method $conforms in object Predef"
   List.empty[(Int,TimeStamp)].sorted  
}                                      

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions