cro*_*ies 5 annotations scala scala-2.10
在Scala 2.9中,我将使用以下命令注释案例类import scala.annotation.target.field:
case class UserAuth(
@(JsonProperty@field)("email")
val email: String,
@(JsonProperty@field)("password")
val password: String
)
Run Code Online (Sandbox Code Playgroud)
在2.10我去编译一个类,我需要使用import scala.annotation.meta.field但突然间它会像疯了一样抛出编译器错误.这是Scala案例类注释的正确用法还是可以恢复为简单@JsonProperty("email")?
看起来这是编译器中的某种奇怪的错误,但我可以确认语法@(JsonProperty@field)("email")usingimport scala.annotation.meta.field确实有效。
看起来类没有正确加载,一个简单的方法sbt clean就解决了这个问题。如果问题仍然存在,将提交错误。
| 归档时间: |
|
| 查看次数: |
908 次 |
| 最近记录: |