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.
caseclassMap[T, S]( ... )
valtag= implicitly[FastTypeTag[Map[List[Int], List[String]]]]
println(tag) // shows Map[t,s] where t,s are type variables
When using AnyUnpickler one wants to unpickle anything inferred from its type. In this case, reflection fails to create an unpickler for that type because t and s are unknown. Why aren't t and s concrete when they could be List[Int] and List[String]? Is this a bug? Otherwise, why doesn't FastTypeTag constructs the tag from the full type?
/cc @jsuereth since he's been refactoring FastTypeTag lately.
The text was updated successfully, but these errors were encountered:
defpickle(f: Foo, b: PBuilder):Unit= {
f match {
caseb: Bar[t] =>// t is a type variable and BarPickle gets an implicit `FastTypeTag`// if we do not put a concrete tag here, one will be created for `t`
barPicklerUnpickler.pickle(b)
casez: Zaz=>???
}
}
I'm not very sure if this behavior is intended by scala pickling. But since a FastTypeTag is a witness of a type, and we expect this type to be concrete, wouldn't be sensible to still consider this as a bug?
I wonder why this happens:
When using
AnyUnpickler
one wants to unpickle anything inferred from its type. In this case, reflection fails to create an unpickler for that type becauset
ands
are unknown. Why aren'tt
ands
concrete when they could beList[Int]
andList[String]
? Is this a bug? Otherwise, why doesn'tFastTypeTag
constructs the tag from the full type?/cc @jsuereth since he's been refactoring
FastTypeTag
lately.The text was updated successfully, but these errors were encountered: