Closed stiller closed 8 years ago
It's not valid syntax, and even more worrying is that the compiler error message prints a type that would also never be valid (even if the ...
were filled somehow). So I think this is not just a bad error message, it is a true compiler bug. The compiler should not say that { a | ..., Counters : ... }
is an Elm type.
I suggest you open an issue at https://github.com/elm-lang/elm-compiler/issues.
After adding type annotation, the error is a little more succinct, but still not correct, I think:
34│ update : Action -> Model -> Model
^^^^^^^^^^^^^^^^^^^^^^^^
The type annotation is saying:
Action -> { ... } -> { ... }
But I am inferring that the definition has this type:
Action -> { a | ..., Counters : ... } -> { a | ..., Counters : ... }
This has a compiler issue in https://github.com/elm-lang/elm-compiler/issues/1374 now. Thanks for reporting!
In https://github.com/evancz/elm-architecture-tutorial/blob/master/examples/3/CounterList.elm#L39 I had accidentally typed
model.Counters
instead ofmodel.counters
, which resulted in this error:Which does hint that the error lies in the second field of the record, but perhaps it could be a bit more focussed. I wonder if
model.Counters ++ [ newCounter ]
is even valid syntax.