NullPointerException on implicit resolution
问题 This code results in NullPointerException: import anotherpackage.MyContext import anotherpackage.builders.aMyContext case class Context(id: String) object Context { implicit def `ContextHolder to Context`(implicit holder: ContextHolder): Context = holder.context } trait ContextHolder { def context: Context } object anotherpackage { case class MyContext(name: String, context: Context) extends ContextHolder object builders { def aMyContext(name: String)(implicit context: Context = Context("test