elm-lang / elm-make

A build tool for Elm projects
BSD 3-Clause "New" or "Revised" License
175 stars 45 forks source link

elm-make reports unhelpful internal error #157

Closed jDomantas closed 6 years ago

jDomantas commented 7 years ago

I tried to run this program in http://elm-lang.org/try:

import Html

main = Html.text "test"

type Foo = Foo

foo : Foo -> Foo
foo Foo = Debug.crash "not implemented"

And I got this error:

elm-make: the annotation added in 'depattern' should not be observed!
elm-make: thread blocked indefinitely in an MVar operation

Trying to compile the same program locally also fails with same error. Elm make version: elm-make 0.18 (Elm Platform 0.18.0).

process-bot commented 7 years ago

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

jDomantas commented 7 years ago

Example could be minimized even further, you can get that error on http://elm-lang.org/try with as much as

foo : () -> ()
foo () = Debug.crash "not implemented"
brianhempel commented 6 years ago

Appears to be the same issue as https://github.com/elm-lang/elm-compiler/issues/1278

brianhempel commented 6 years ago

Workaround: If you just need a thunk to crash, change () to _ in the definition.

foo : () -> ()
foo _ = Debug.crash "not implemented"
evancz commented 6 years ago

Thanks for linking to the other version of this @brianhempel!

It compiles with no problem on my development build, and a temporary fix has been found until that is released.