我正在使用Shapeless 2.2.5。 我尝试使用以下代码将元组转换为HList。
import shapeless._
import syntax.std.product._
(23, "foo", 2.0, true).productElements
但我遇到了编译错误。
[error] /scala/testScala/src/test/scala/lombok/shapeless/TestTuple2HList.scala:12: could not find implicit value for parameter gen: shapeless.Generic[(Int, String, Double, Boolean)]
[error] (23, "foo", 2.0, true).productElements
在https://github.com/milessabin/shapeless/blob/master/core/src/test/scala/shapeless/conversions.scala中的测试conversions.scala未提供Generic[(Int,String,Double,Boolean)]的隐式值。
我错过了一些导入吗?
非常感谢您的任何帮助!
Shing