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 upNaming or shadowing issue with `arguments` field in record sent through port #611
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
schpaa
May 18, 2016
Investigating further, this peculiar thing revealed itself to me:
Gives back arguments as undefined in the browser-console, all the other works.
type alias MyRecord =
{ command : String
, arguments : String
, extra : Int
}This one works, any shadowing happening with arguments here?
type alias MyRecord =
{ command : String
, argumentodos : String
, extra : Int
}
schpaa
commented
May 18, 2016
|
Investigating further, this peculiar thing revealed itself to me: Gives back type alias MyRecord =
{ command : String
, arguments : String
, extra : Int
}This one works, any shadowing happening with type alias MyRecord =
{ command : String
, argumentodos : String
, extra : Int
} |
schpaa
changed the title from
Sending a Record with a List String through a Port fails
to
Sending a Record with a List String through a Port fails (became Shadowing issue with `arguments`)
May 18, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Related to elm/compiler#994? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
schpaa
commented
May 18, 2016
|
Yes, it seems so. What should I do? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jvoigtlaender
May 18, 2016
Contributor
I think: Open a new issue at the https://github.com/elm-lang/elm-compiler repository. Put an http://sscce.org/ into the first comment on that new issue.
If possible, try to capture the "old" case from elm/compiler#994 as well. (It seems that your problem is about outgoing ports, whereas the one originally reported there was about incoming ports. But the base problem, reserved JS names in stuff going through ports, seems to be the same. So it would be great if you could cover both, since the underlying bug for both might be the same. That probably means you would have to come up with two SSCCEs.)
|
I think: Open a new issue at the https://github.com/elm-lang/elm-compiler repository. Put an http://sscce.org/ into the first comment on that new issue. If possible, try to capture the "old" case from elm/compiler#994 as well. (It seems that your problem is about outgoing ports, whereas the one originally reported there was about incoming ports. But the base problem, reserved JS names in stuff going through ports, seems to be the same. So it would be great if you could cover both, since the underlying bug for both might be the same. That probably means you would have to come up with two SSCCEs.) |
jvoigtlaender
changed the title from
Sending a Record with a List String through a Port fails (became Shadowing issue with `arguments`)
to
Naming or shadowing issue with `arguments` field in record sent through port
Jun 3, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Mar 7, 2018
Member
Tracking in elm/compiler#1685 now. This will make it easier to fix them all in one batch. Thank you for the report!
|
Tracking in elm/compiler#1685 now. This will make it easier to fix them all in one batch. Thank you for the report! |
schpaa commentedMay 18, 2016
I want to send
MyRecordthrough a port. But it fails with the console message:TypeError: undefined is not an object (evaluating 'xs.ctor')This is what I'm doing, javascript first:
in some port module I have defined the port:
where
MyRecordis defined as:somewhere in the view-function, this happens:
supported by my update-function:
To fix/bypass
If I change
MyRecordand substitute theList Stringwith aString, like this:there are no messages in the console, and the program works.