-
Notifications
You must be signed in to change notification settings - Fork 79
SPickler does not support traits #3
Comments
Matthieu, I think this does what you want: implicit def cPickler[T <: X] = new CustomPickler[T] |
We don't have much for documentation (yet) of scala-pickling (besides an academic paper which covers some of these things, but is definitely not ideal for developers). Apologies– comprehensive documentation is on the way. An important detail that you might not know is that That means that when you define: implicit def cPickler = new CustomPickler[X] A implicit def cPickler[T <: X] = new CustomPickler[T] |
Could you let us know if this clarifies things/solves your problem? |
It clarifies this point yes, thanks. I stay tuned for more documentation then ! |
Awesome- thanks, closing this then. :) |
I try to defined a dummy SPickler this way:
then I defined an implicit this way:
where Y extends the trait X:
but it does not apply the the pickle method I defined in the CustomPickler class, whereas it does if replacing X by Y in the definition of the implicit. Conclusion: SPickler does not support the trait (if I correctly coded the things), which is a big limitation.
The text was updated successfully, but these errors were encountered: