#2726 Serialising Nested Maps

SlimerDude Fri 11 Jan

If I serialise a nested Map:

val := [6:[6:6]]
str := StrBuf() { it.out.writeObj(val) }.toStr
  // -> [sys::Int:[sys::Int:sys::Int]][6:[sys::Int:sys::Int][6:6]]

But if I then attempt to de-serialise it:

str.in.readObj

sys::IOErr: Expected type signature, not '[' [Line 1]
  fanx.serial.ObjDecoder.err (ObjDecoder.java:666)
  fanx.serial.ObjDecoder.err (ObjDecoder.java:663)
  fanx.serial.ObjDecoder.err (ObjDecoder.java:674)
  fanx.serial.ObjDecoder.verify (ObjDecoder.java:720)
  fanx.serial.ObjDecoder.consumeId (ObjDecoder.java:686)
  fanx.serial.ObjDecoder.readSimpleType (ObjDecoder.java:603)
  fanx.serial.ObjDecoder.readType (ObjDecoder.java:572)
  fanx.serial.ObjDecoder.readType (ObjDecoder.java:569)
  fanx.serial.ObjDecoder.readType (ObjDecoder.java:581)
  fanx.serial.ObjDecoder.readCollection (ObjDecoder.java:395)
  fanx.serial.ObjDecoder.readObj (ObjDecoder.java:127)
  fanx.serial.ObjDecoder.readObj (ObjDecoder.java:55)
  fan.sys.InStream.readObj (InStream.java:641)
  fan.sys.InStream.readObj (InStream.java:638)
  acme::Example.main (Example.fan:XX)

I also get exactly the same error in Javascript too (where I was originally attempting to inflate objects) - so bonus points for being consistent!

brian Mon 14 Jan

Ticket promoted to #2726 and assigned to brian

Login or Signup to reply.