0
として、私はケースクラスのパラメータは、一般的なことができるようにしようとしています:有界ジェネリック型ケースクラスパラメータ
trait RequestEntityMarshallable
case class ImportConfirmMessage(bla: String) extends RequestEntityMarshallable
case class Req(entity: _ <: RequestEntityMarshallable)
私はentity: _ <: RequestEntityMarshallable
でunbound wildcard type
コンパイル・エラーが発生しますが。これを行う正しい方法は何ですか?
感謝しています。 'Req'を他の関数のパラメータとして使うときに何を変更する必要があります。たとえば、 'def send(req:Req):Future [HttpResponse]'は、RequestEntityMarshallableの任意のサブタイプに対するReqインスタンスで呼び出すことができます。 – novon
私は 'def send [T <:RequestEntityMarshallable](req:Req [T]):Future [HttpResponse]' – novon
@novon nice :)で作業していると思います。 – pamu