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

Cannot use the unit type in ports #594

Closed
toburger opened this Issue May 11, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@toburger

toburger commented May 11, 2016

I'm trying to migrate the code from this blog post into elm 0.17: http://tech.noredink.com/post/126978281075/walkthrough-introducing-elm-to-a-js-web-app
I've got it to work here: https://github.com/toburger/elm-todomvc/tree/feature/elm17

However it is not possible to create a port using a unit type.

When trying to compile this code:
port dispatchDestroyCompleted : (() -> msg) -> Sub msg
I get a runtime error saying: _Tuple0 is not defined

somehow unit gets transpiled into a tuple value.

When I change it to:
port dispatchDestroyCompleted : (List Int -> msg) -> Sub msg
everything works, but it doesn't resemble the intention of the port as clear as before.

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender May 11, 2016

Contributor

Known issue with (apparently) known fix. elm/compiler#1367, elm/compiler#1361

Contributor

jvoigtlaender commented May 11, 2016

Known issue with (apparently) known fix. elm/compiler#1367, elm/compiler#1361

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment