elm / compiler

Compiler for Elm, a functional language for reliable webapps.
https://elm-lang.org/
BSD 3-Clause "New" or "Revised" License
7.51k stars 656 forks source link

Error called at Type/Solve.hs:206:15 -- thread blocked indefinitely in an MVar operation -- caused by type signature with type variable with wrapped phantom types #2185

Open SiriusStarr opened 3 years ago

SiriusStarr commented 3 years ago

Quick Summary: While trying to compile valid code with a wrapped phantom type and incomplete type signatures, compiler crashes with the following error (boilerplate parts excluded):

Compiling ...elm: You ran into a compiler bug. Here are some details for the developers:

    a [rank = 2]

CallStack (from HasCallStack):
  error, called at compiler/src/Type/Solve.hs:206:15 in main:Type.Solve

>   thread blocked indefinitely in an MVar operation

SSCCE

module Main exposing (func)

type Wrapper a
    = Wrapper (Internal a)

type Internal a
    = Internal

func internal =
    let
        x : Wrapper a
        x =
            Wrapper internal
    in
    True

Additional Details

This is valid code and should compile, but the compiler seems to fail to infer the type func : Internal a -> Bool.

github-actions[bot] commented 3 years ago

Thanks for reporting this! To set expectations:

Finally, please be patient with the core team. They are trying their best with limited resources.