将来例外を処理し、新しい未来を返す関数を作成しようとしていますが、問題が発生しており、エラー メッセージを理解できません。
scala> def composeHandlingFuture[T](fut: Future[T], default: T): Future[T] =
| fut recover { case e: Exception => default }
<console>:19: error: type mismatch;
found : default.type (with underlying type A1 => B1)
required: T
fut recover { case e: Exception => default }
^
署名が必要default.type
とするのと同じではありませんか? T
とどのように関係がありtype A1 => B1
ますか?
どんな助けでも感謝します。
PS私はScala 2.10.1を使用しています