1
如何在Ququotquote中使用Shapeless?
我正在尝试Shapeless从quasiquotewith中调用宏Scala,但没有得到我想要的东西。 我的宏不会返回任何错误,但不会扩展Witness(fieldName)为Witness.Lt[String] val implicits = schema.fields.map { field => val fieldName:String = field.name val fieldType = TypeName(field.valueType.fullName) val in = TermName("implicitField"+fieldName) val tn = TermName(fieldName) val cc = TermName("cc") q"""implicit val $in = Field.apply[$className,$fieldType](Witness($fieldName), ($cc: $className) => $cc.$tn)""" } 这是我的Field定义: sealed abstract class Field[CC, FieldName] { val fieldName: String type …