In my update function I have something like:

    LoginPassword str ->
      let login = { model.login | pass = str }
      in ({ model | login = login }, Cmd.none)

Which I was hoping would correspond to updating the "pass" field of the 
record at model.login. Instead I get a compiler error:

-- SYNTAX PROBLEM ----------------------------------------------------- Main
.elm

I ran into something unexpected when parsing your code! 

94|       let login = { model.login | name = str } 
                             ^

I am looking for one of the following things: 

    "|" 
    an equals sign '=' 
    more letters in this name 
    whitespace 

Detected errors in 1 module.

Breaking it down a bit more to:

    LoginPassword str ->
      let
        lm = model.login
        login = { lm | pass = str }
      in ({ model | login = login }, Cmd.none)

Seems to be fine.

I feel like this is a compiler bug; is there any good reason why it 
shouldn't work as expected?

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to