トレイト: UserAccountRepository[M[_]] https://github.com/j5ik2o/scala-ddd-base/blob/master/example/src/main/scala/com/github/j5ik2o/dddbase/example/repository/UserAccountRepository.scala
実装: UserAccountRepositoryBySkinny https://github.com/j5ik2o/scala-ddd-base/blob/master/example/src/main/scala/com/github/j5ik2o/dddbase/example/repository/skinny/UserAccountRepositoryBySkinny.scala
があったとして、以下のようなDIをさせたいのですが、
val design = newDesign.bind[UserAccountRepository[BySkinny]].toInstance(UserAccountRepository.bySkinny)
以下のようなエラーが発生します。サポート外ですかね? けっこうScalaならではの使い方なのでサポートしてくれると、他のコンテナより優位かもですが…階数とか考えるとめんどいですかね…。
An exception or error caused a run to abort: Surface com.github.j5ik2o.dddbase.example.repository.UserAccountRepository.BySkinny is not found in cache
java.lang.IllegalArgumentException: Surface com.github.j5ik2o.dddbase.example.repository.UserAccountRepository.BySkinny is not found in cache
at wvlet.surface.reflect.SurfaceFactory$$anonfun$get$1.apply(SurfaceFactory.scala:53)
at wvlet.surface.reflect.SurfaceFactory$$anonfun$get$1.apply(SurfaceFactory.scala:53)
at scala.collection.MapLike$class.getOrElse(MapLike.scala:128)
at scala.collection.AbstractMap.getOrElse(Map.scala:59)
at wvlet.surface.reflect.SurfaceFactory$.get(SurfaceFactory.scala:53)
at wvlet.surface.package$.getCached(package.scala:28)
at wvlet.surface.LazySurface.ref(Surfaces.scala:206)
at wvlet.surface.LazySurface.params(Surfaces.scala:217)
Successfully reproduced this error in wvlet/airframe#242.
I'm going to check the cause of this issue.
Thanks.