EindbaasExpress / handsonscala-issuemigrator

Part of the HandsOnScala Course
0 stars 0 forks source link

upack doesn't roundtrip `Ext` nested inside another `Msg` #124

Open EindbaasExpress opened 2 years ago

EindbaasExpress commented 2 years ago

Here's a minimal roundtripping failure:

val msg = upack.Arr(upack.Ext(33, new Array[Byte](4)), upack.False)
val bytes = upack.writeToByteArray(msg)
val msg2 = upack.read(bytes)

This decodes as upack.Arr(upack.Ext(33, new Array[Byte](4)), upack.Int32(33)) (the last bit is the problem: upack.Int32(33) instead of upack.False). ID: 369 Original Author: harpocrates