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
Deserialization fails in an unexpected way in following code. No exception is thrown, however from field of Container is deserialized as Map instead of XY, the program outputs:
For example, the compiler doesn't even know what type the imported Vector2f is:
println(manifest[Vector2f])
Yields the errors:
Error:(41, 21) No Manifest available for Abstract.Link.Vector2f.
println(manifest[Vector2f])
It knows what the type is supposed to be if your link doesn't cast to the super:
objectAbstract {
valLink=Concrete
}
Or
objectAbstract {
valLink:Concrete.type=Concrete
}
The only way that the compiler is figuring out how to construct an XY in val input = Container(Vector2f(0,0)) is because of the companion object that you've fabricated to get around the fact that the type is unknown in the abstract class.
I think you're going to want to approach this problem from another angle. Is this something you're still trying to work on?
OndrejSpanel
added a commit
to OndrejSpanel/JacksonTypeAlias
that referenced
this issue
Jul 30, 2018
Deserialization fails in an unexpected way in following code. No exception is thrown, however
from
field ofContainer
is deserialized asMap
instead ofXY
, the program outputs:This happens only if the
Vector2f
is used asimport Abstract.Link.Vector2f
. Once you change it toConcrete.Vector2f
it works fine.The text was updated successfully, but these errors were encountered: