jerkson icon indicating copy to clipboard operation
jerkson copied to clipboard

Can't parse case class with type-alias field

Open jdanbrown opened this issue 13 years ago • 1 comments

import com.codahale.jerkson.Json

object A {

  type Z = Int
  case class Ok(x: Int)
  case class Bad(x: Z)

  def main(args: Array[String]) {
    println(Json.parse[Ok]("""{"x":3}"""))
    println(Json.parse[Bad]("""{"x":3}""")) // ERROR: java.lang.ClassNotFoundException: Z
  }

}

jdanbrown avatar Sep 03 '12 01:09 jdanbrown

Hi! It's a known issue, unfortunately. You have to deal with types by their own names.

imikushin avatar Sep 04 '12 06:09 imikushin