Skip to content
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

Compiler gives an error on destructuring a non existent record field #1748

Open
rl-king opened this issue Aug 19, 2018 · 0 comments
Open

Compiler gives an error on destructuring a non existent record field #1748

rl-king opened this issue Aug 19, 2018 · 0 comments

Comments

@rl-king
Copy link

rl-king commented Aug 19, 2018

Error

./elm make --debug src/Main.elm --output dist/elm.js
elm: ./Data/Vector/Generic/Mutable.hs:703 (modify): index out of bounds (3,3)
CallStack (from HasCallStack):
  error, called at ./Data/Vector/Internal/Check.hs:87:5 in vector-0.12.0.1-4FlkEWKNqrgLl7wn5Cpq3g:Data.Vector.Internal.Check
elm: thread blocked indefinitely in an MVar operation
make: *** [all] Error 1

SSCCE

module Main exposing (..)

import Browser
import Html exposing (..)


main : Program () { window : Int } msg
main =
    Browser.sandbox
        { init = 1
        , view = view
        , update = \_ model -> model
        }


foo : Float
foo =
    0


bar : { window : Int } -> Float
bar model =
    1


view ({ iDontExist } as model) =
    let
        _ =
            foo iDontExist <| bar model
    in
    Html.text ""

Notes

  • Adding a type annotation to the view function makes the error go away
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant