Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error building a new JObject #2

Closed
mattaylor opened this issue Dec 14, 2018 · 1 comment
Closed

Error building a new JObject #2

mattaylor opened this issue Dec 14, 2018 · 1 comment

Comments

@mattaylor
Copy link

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)
...
@mattaylor
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant