我正在尝试使用avro4s FieldMapper映射案例类的字段。
implicit val short: FieldMapper = {
case "fieldName1" => "fieldName2"
}
但我收到以下错误:
Error:(20, 39) missing parameter type for expanded function
The argument types of an anonymous function must be fully known. (SLS 8.5)
Expected type was: com.sksamuel.avro4s.FieldMapper
implicit val short: FieldMapper = {
我发现与此错误相关的类似问题:
- Scala:扩展函数的类型缺少参数类型匿名函数的参数类型必须是完全已知的。(SLS 8.5)
- Scala 缺少扩展函数的参数类型匿名函数的参数类型必须是完全已知的。(SLS 8.5)
- 匿名函数的参数类型必须是完全已知的。(SLS 8.5)
但是,我无法为我的特定问题找到解决方案。
任何帮助表示赞赏!