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 uptoString isn't type safe for Html #560
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jvoigtlaender
Apr 17, 2016
Contributor
As I explained in the other repository, there is already an issue open on this in this repository here. It makes zero sense to have another issue open. So I'm closing this.
|
As I explained in the other repository, there is already an issue open on this in this repository here. It makes zero sense to have another issue open. So I'm closing this. |
jvoigtlaender
closed this
Apr 17, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jvoigtlaender
Apr 17, 2016
Contributor
The relevant issue is https://github.com/elm-lang/core/issues/488, and there is already a candidate PR about fixing it (https://github.com/elm-lang/core/pull/183).
|
The relevant issue is https://github.com/elm-lang/core/issues/488, and there is already a candidate PR about fixing it (https://github.com/elm-lang/core/pull/183). |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
emptyflash
Apr 18, 2016
Ah, my bad, I misunderstood the corresponding issue part. Thanks for the references!
emptyflash
commented
Apr 18, 2016
|
Ah, my bad, I misunderstood the corresponding issue part. Thanks for the references! |
emptyflash commentedApr 17, 2016
Originally posted at elm/compiler#1347
I get a runtime error from this code
The error given is
Uncaught TypeError: Cannot use 'in' operator to search for 'ctor' in nullcoming from the generatedtoStringfunction. I think this has something to do with the fact thattypeoffor null returns "object", but this lineelse if (type === 'object' && 'ctor' in v)throws an error if v is null.Here's my generated code:
I don't actually want to convert the Html to a string, the Elm code above was a mistake, but it seems like maybe the compiler could have caught or handled it.
If someone could point me in the right direction, I would be more than willing to fix this.