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

Outgoing ports do not convert field names containing prime (single quote) properly #616

Closed
psfblair opened this Issue May 20, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@psfblair

psfblair commented May 20, 2016

I have a type alias that for various reasons that may not have been too good looked like this:

type alias EventForServer = 
  { application'Common'Events'EventForServer: Bool
  , seqNum: Int
  , data: Json.Encode.Value 
  }

When I run tests I get

build/test.js:7364
        return {application'Common'Events'EventForServer: v.application'Common'Events'EventForServer, seqNum: v.seqNum, data: v.data};
                     ^^^^^^^^^^^^^

SyntaxError: Unexpected string

The test.js code looks like this:

var _user$project$Web_Messaging$eventsForServer = _elm_lang$core$Native_Platform.outgoingPort(
    'eventsForServer',
    function (v) {
        return {application'Common'Events'EventForServer: v.application'Common'Events'EventForServer, seqNum: v.seqNum, data: v.data};
});

It looks to me like some escaping is missing here.

@princejwesley

This comment has been minimized.

Show comment
Hide comment
@princejwesley

princejwesley commented Jun 14, 2016

Reported here

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Jul 1, 2016

Member

Closing in favor of the one on the compiler repo

Member

evancz commented Jul 1, 2016

Closing in favor of the one on the compiler repo

@evancz evancz closed this Jul 1, 2016

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