I see that most people who have been playing with ScalaSigParser, in an effort to ser/des idiomatic Scala case classes in a nice way, have avoided this issue, but I'd like to know if it's possible. I have a situation much like the following:
trait OuterTrait {
abstract class InnerAbstract(i: Int)
}
object OuterObject extends OuterTrait {
case class InnerConcrete(i: Int) extends InnerAbstract(i)
}
val bippy = OuterObject.InnerConcrete(123)
val s = serialize(bippy)
// time passes...
val obj = deserialize[OuterObject.InnerConcrete](s)
So, I can find the ScalaSig for OuterTrait, but I haven't managed to find a nice general way to identify the outer object from the InnerConcrete class. Any protips?
If the problem is navigating from the Class
of the inner object to the Class
of the outer object, the issue may be fixed in Scala trunk, one of the tickets concerned beeing SI-4983.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With