Araq/packedjson

Error building a new JObject

Closed this issue · 1 comments

Im trying to use swap json out with packedJson but am stuck with an error that makes no sense to me.

This is my function

func `%`*(t : StringTableRef): JsonNode =
  let o = newJObject()
  if t == nil: return
  for i,v in t: o[i] = newJString(v)

which compiles fine under stdlib but with packedJson I get the following..

whip.nim(24, 18) Error: type mismatch: got <JsonTree, string, JsonNode>
but expected one of:
proc `[]=`(obj: var JsonTree; key: string; val: JsonNode)
...

Never mind - I found the issue (let != var)