Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upJson.Decode.decodeString throws runtime for types with cyclic dependencies #653
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
process-bot
Jul 1, 2016
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!
Here is what to expect next, and if anyone wants to comment, keep these things in mind.
process-bot
commented
Jul 1, 2016
|
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it! Here is what to expect next, and if anyone wants to comment, keep these things in mind. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tiziano88
Jul 1, 2016
Actually, I managed to simplify the example even more; now it only contains three actual types, with a cyclic dependency between them. I am actually not sure what the expected outcome should be in this case, but definitely not a runtime error.
tiziano88
commented
Jul 1, 2016
|
Actually, I managed to simplify the example even more; now it only contains three actual types, with a cyclic dependency between them. I am actually not sure what the expected outcome should be in this case, but definitely not a runtime error. |
tiziano88
changed the title from
Json.Decoder throws runtime error
to
Json.Decode.decodeString throws runtime for types with cyclic dependencies
Jul 1, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
tiziano88
Jul 1, 2016
Turns out, even a single recursive type and associated decoder is enough (see updated Gist).
tiziano88
commented
Jul 1, 2016
|
Turns out, even a single recursive type and associated decoder is enough (see updated Gist). |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jvoigtlaender
Jul 2, 2016
Contributor
See issue 873 in the elm-compiler repo, in particular also all the discussion there and in its linked references about the Json decoding special case.
|
See issue 873 in the elm-compiler repo, in particular also all the discussion there and in its linked references about the Json decoding special case. |
jvoigtlaender
closed this
Jul 2, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jvoigtlaender
Jul 2, 2016
Contributor
That is, elm/compiler#873 (comment) (indicating how to work around this for Json decoders specially).
|
That is, elm/compiler#873 (comment) (indicating how to work around this for Json decoders specially). |
tiziano88 commentedJul 1, 2016
System details:
Elm Platform 0.17.0
Chrome Version 51.0.2704.103 (64-bit)
Ubuntu Linux 14.04 LTS
Error:
Reproducible with the following example (even pasting it in http://elm-lang.org/try):
https://gist.github.com/tiziano88/7beb26152275326eb77bf9f754f14d9d
(I cut it down considerably from the original project, now it seems to be the minimal configuration that reliably causes the error)
I suspect the issue is due to the circular type dependencies, even though only two of the type involved are aliases, and the other two are actual types.