9
定義空形質テスト):ケースクラスのコンパニオンオブジェクト生成エラー
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 any scala.Double to any AnyRef.
You may wish to use a type ascription: `x: java.lang.Double`.
しかし、それは完全にのために働くされています
scala> case class Foo(a: List[Int] with Test)
defined class Foo
そして、メソッド定義で問題はない:
scala> def foo(a: Int with Test) = ???
foo: (a: Int with Test)Nothing
Scalaのバージョン2.10.3
それは通常のコンパイラの動作ですか?
これは、[既知の問題](https://issues.scala-lang.org/browse/SI-5183です)。 –