Cannot specialize a Scala method with specializable trait as return type

17 views
Skip to first unread message

Tongfei Chen

unread,
Feb 3, 2016, 11:37:31 AM2/3/16
to scala-user
trait Eq[@specialized -X] {
  def eq(x: X, y: X): Boolean
}

trait Keyed[@specialized(Int) X] {
  def eqOnKey: Eq[X]
}

The method eqOnKey is not specialized in the generated class Keyed$mcI$sp.

How can I specialize this method, i.e. making the return type of method eqOnKey$mcI$sp in class Keyed$mcI$sp to be Eq$mcI$sp?

Reply all
Reply to author
Forward
0 new messages