compound-type

Case class companion object generation error for compound type

元气小坏坏 提交于 2019-12-06 20:12:03
问题 Defined empty trait Test: trait Test what used in compound type: scala> val a : Int with Test = 10.asInstanceOf[Int with Test] a: Int with Test = 10 and case class with parameter of compound type (like Unboxed Tagged Type): scala> case class Foo(a: Int with Test) error: type mismatch; found : Double required: AnyRef Note: an implicit exists from scala.Double => java.lang.Double, but methods inherited from Object are rendered ambiguous. This is to avoid a blanket implicit which would convert