You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.
I'm trying to generate picklers and unpicklers for Spores. One problem I'm hitting is that despite having static picklers/unpicklers for a given Spore, scala-pickling generates their own brand-new picklers/unpicklers. For instance, let's say we have this:
The aforementioned problem appears when we don't have a Pickler/Unpickler for B. Therefore, scala-pickling will infer that there's no Pickler/Unpickler for the spore type and generate them as well.
In my opinion, a fix for this problem is to change how the algorithm proceeds. If there's no Pickler/Unpickler for B, we generate them and then check if there's now a Pickler/Unpickler that matches Spore[T,S] and compose them.
If my previous analysis is not correct, this may be a problem caused by a bad registration of Picklers and Unpicklers. I'm using HybridRuntime. Also note that I am not using staticOnly.
This only affects scala pickling v0.11.x.
The text was updated successfully, but these errors were encountered:
Just want to clarify that the Picklers/Unpicklers of Spore are not generated in the call site. I propagate the Picklers/Unpicklers of S through my API and then at some point invoke those implicitly. If before those statements I place implicitly[B[S]], the problem disappears because scala pickling detects a type R (B[S]) which is able to fit in Spore[T, R].
Can you place a small reproducable example? I'm having trouble seeing this myself, and I'd like to try to fix it.
Note: one of my larger TODO items is to clean up how dependent-picklers are looked up in teh macros. Right now it's a recursive chain of macro-invocation for implciitly finding picklers. may remain that way, but be less flaky in the future...
I'm trying to generate picklers and unpicklers for
Spore
s. One problem I'm hitting is that despite having static picklers/unpicklers for a givenSpore
, scala-pickling generates their own brand-new picklers/unpicklers. For instance, let's say we have this:Types
T
andS
are concrete in the call site.The aforementioned problem appears when we don't have a
Pickler
/Unpickler
forB
. Therefore, scala-pickling will infer that there's noPickler
/Unpickler
for the spore type and generate them as well.In my opinion, a fix for this problem is to change how the algorithm proceeds. If there's no
Pickler
/Unpickler
forB
, we generate them and then check if there's now aPickler
/Unpickler
that matchesSpore[T,S]
and compose them.If my previous analysis is not correct, this may be a problem caused by a bad registration of
Pickler
s andUnpickler
s. I'm usingHybridRuntime
. Also note that I am not usingstaticOnly
.This only affects scala pickling
v0.11.x
.The text was updated successfully, but these errors were encountered: