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 upruntime error in Json decoding #704
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
process-bot
Aug 30, 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
Aug 30, 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.
goertzenator
Aug 30, 2016
I've boiled this down to a much simpler example, and it may just be my misunderstanding of the language. In let y = y I assume this to mean "Create a local variable named y with the same value as the module-scoped y." But something else is clearly happening and instead of seeing the output "123" I see "<internal structure>".
I'm leaving the Json case above in place because it manifests in a more serious javascript crash.
import Html exposing (text)
main =
text (toString x)
x : Int
x =
let
--y = 123 -- this outputs "123"
y = y -- this outputs "<internal structure>"
in
y
y = 123 -- not needed in "y = y" case
goertzenator
commented
Aug 30, 2016
|
I've boiled this down to a much simpler example, and it may just be my misunderstanding of the language. In I'm leaving the Json case above in place because it manifests in a more serious javascript crash. import Html exposing (text)
main =
text (toString x)
x : Int
x =
let
--y = 123 -- this outputs "123"
y = y -- this outputs "<internal structure>"
in
y
y = 123 -- not needed in "y = y" case |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Duplicate of elm/compiler#873 |
goertzenator commentedAug 30, 2016
I have a Json decoder that creates a JS runtime error when executed. Note that
decodeOffsetsis factored out as a separate function:The incorrect JS that is generated is...
In the above the
decodeOffsetsparameter todecodeOffsets = A2(...I assume should actually be referring to this function:But it doesn't, and it eventually crashes. :(
This is on
elm-lang/core-4.0.5.