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

json.to fails with ref Bar #12316

Closed
dawkot opened this issue Oct 1, 2019 · 1 comment · Fixed by #12391
Closed

json.to fails with ref Bar #12316

dawkot opened this issue Oct 1, 2019 · 1 comment · Fixed by #12391

Comments

@dawkot
Copy link

dawkot commented Oct 1, 2019

import json

type
  Foo = ref Bar
  Bar = object

discard "".parseJson.to Foo

/usercode/in.nim(7, 21) template/generic instantiation of to from here
/nim/lib/pure/json.nim(1217, 11) Error: type mismatch: got <typeof(nil)> but expected 'Bar = object'

@dawkot
Copy link
Author

dawkot commented Oct 3, 2019

This is especially bad because of #8457

krux02 added a commit to krux02/Nim that referenced this issue Oct 8, 2019
Araq pushed a commit that referenced this issue Oct 17, 2019
* closes #12316
* make tjsonmacro work at js target
* closes #12289
* closes #11988
* also fixed gdb related stuff
alehander92 pushed a commit to alehander92/Nim that referenced this issue Dec 2, 2019
* closes nim-lang#12316
* make tjsonmacro work at js target
* closes nim-lang#12289
* closes nim-lang#11988
* also fixed gdb related stuff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants