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

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 this issue Apr 1, 2021 · 1 comment

Comments

@SiriusStarr
Copy link

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
  • Elm: 0.19.1
  • Browser: N/A
  • Operating System: Linux

Additional Details

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

  • The error does not occur if neither func nor x have type signatures
  • The error does not occur if both func and x have type signatures
  • The error does not occur if only func has a type signature
  • The error does not occur if x has a concrete type, e.g. x : Wrapper MyType
@github-actions
Copy link

github-actions bot commented Apr 1, 2021

Thanks for reporting this! To set expectations:

  • Issues are reviewed in batches, so it can take some time to get a response.
  • Ask questions in a community forum. You will get an answer quicker that way!
  • If you experience something similar, open a new issue. We like duplicates.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants