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

Initialization Error on port : invalid 'instanceof' operand Array #2

Open
ghost opened this issue Apr 6, 2014 · 1 comment
Open

Comments

@ghost
Copy link

ghost commented Apr 6, 2014

Apparently Array overrides the Javascripts default Array type which causes an error in elm. I'm trying to initialize a port with a tuple.

foo.elm

module MyFoo where

import Array

port fooPort : Signal (Int, Int)

main = plainText (show fooPort)

index.html

<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="UTF-8"><title>foo</title>
        <script type="text/javascript" src="elm-runtime.js"></script>
        <script type="text/javascript" src="elm_dependencies/xashili-Array/0.2.2/Native/Array.js"></script>
        <script type="text/javascript" src="foo.js"></script>
    </head>
    <body>
        <script type="text/javascript">Elm.worker(Elm.MyFoo, { fooPort : [0, 0] } )</script>
    </body>
</html>
elm -m --script=elm_dependencies/xashili-Array/0.2.2/Native/Array.js --script=foo.js --runtime=elm-runtime.js --only-js foo.elm
@xash
Copy link
Owner

xash commented Apr 6, 2014

Thanks for reporting, never thought of trying this! As Arrays get into the standard library and this is kind of a compiler bug, I opened an issue there: elm/compiler#576

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant