Skip to content

thread blocked indefinitely in an MVar operation #2176

Open
@dotKuro

Description

@dotKuro

Quick Summary:

When using the extensible record syntax to avoid duplicate fields in similiar data types, I crash the compiler when trying to convert between the similir types.

The error occurs when running elm make on the provided code.

This seems to be related to #2146. I still open this issue though because the compiler error encouraged me to do so, if my example looks different.

SSCCE

module Example exposing (..)


type alias ExtensibleT extension dataT =
    { extension | data : dataT }

type alias TWithOutExtension dataT =
    ExtensibleT () dataT

type alias TWithSimpleExtension dataT =
    ExtensibleT { simple : Int } dataT


addExtension : TWithOutExtension dataT -> TWithSimpleExtension dataT
addExtension { data } = { data = data, simple = 0 }
  • Elm: 0.19.1
  • Browser: --
  • Operating System: Linux 5.10.16

Additional Details

  • The example does compile when the addExtension function is not in the code.
  • Exact output of the compiler:
Compiling ...elm: Used toAnnotation on a type that is not well-formed
CallStack (from HasCallStack):
  error, called at compiler/src/Type/Type.hs:413:21 in main:Type.Type

-- ERROR -----------------------------------------------------------------------

I ran into something that bypassed the normal error reporting process! I
extracted whatever information I could from the internal error:

>   thread blocked indefinitely in an MVar operation

These errors are usually pretty confusing, so start by asking around on one of
forums listed at https://elm-lang.org/community to see if anyone can get you
unstuck quickly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions