Scala shapeless Generic.Aux implicit parameter not found in unapply
问题 I encountered the following problem with implicits in Scala, using Shapeless's Generic.Aux : case class Complex(re: Double, im: Double) object Prod2 { def unapply[C, A, B](c: C)(implicit C: Generic.Aux[C, A :: B :: HNil]) = Some((C.to(c).head, C.to(c).tail.head)) } val c = Complex(1.0, 2.0) val Prod2(re, im) = c The code above does not compile. It reports Error:(22, 7) could not find implicit value for parameter C: shapeless.Generic.Aux[nexus.ops.Test.Complex,A :: B :: shapeless.HNil] val