Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Did Scala case class annotations change in 2.10?

In Scala 2.9 I would annotate a case class using the import scala.annotation.target.field:

case class UserAuth(
  @(JsonProperty@field)("email")
  val email: String,

  @(JsonProperty@field)("password")
  val password: String
)

In 2.10 I go to compile a class, and I need to use import scala.annotation.meta.field but suddenly it's throwing compiler errors like crazy. Is this the proper usage of the Scala case class annotation or can I revert back to simple @JsonProperty("email")?

like image 241
crockpotveggies Avatar asked Oct 04 '22 03:10

crockpotveggies


1 Answers

Looks like it was some sort of weird bug in the compiler, but I can confirm that the syntax @(JsonProperty@field)("email") using import scala.annotation.meta.field does work.

Looks like classes weren't loading properly and a simple sbt clean fixed the issue. Will file a bug if the problem persists.

like image 122
crockpotveggies Avatar answered Oct 11 '22 00:10

crockpotveggies