Closed gilesbowkett closed 5 years ago
This was a bug that got introduced in 0.19.0 I believe. The fix was https://github.com/elm/compiler/commit/a5febad184588ae79b404d22a020020408580041, so my development build is now producing the following error:
-- TYPE MISMATCH ------------------------------------------------------ temp.elm
The 1st argument to `element` is not what I expect:
51| Browser.element
52|> {
53|> init = always init,
54|> view = view,
55|> update = update,
56|> subscriptions = subscriptions
57|> }
This argument is a record of type:
{ init : flags -> List TermFrequency -> ( Model, Cmd Message )
, subscriptions : Model -> Sub Message
, update : Message -> Model -> ( Model, Cmd Message )
, view : Model -> Html Message
}
But `element` needs the 1st argument to be:
{ init : flags -> ( Model, Cmd Message )
, subscriptions : Model -> Sub Message
, update : Message -> Model -> ( Model, Cmd Message )
, view : Model -> Html Message
}
Hint: It looks like it takes too many arguments. I see 1 extra.
The fix should be available once Elm 0.19.1 is released. Thank you for reporting this!
thank you for Elm!
Hi — I'm getting an error message where Elm tells me I gave it X when it was expecting Y.
Problem is, X and Y are identical.
It is actually super easy to fix the problem, but the fix has no very obvious connection to the error message, at least not for me (did a bunch of work with Elm in 2016, have only played with it here and there since).
Here's the program which triggered the error for me:
Changing
init = always init
toinit = init
gets rid of the error.Thanks!