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 Bug: Pathological example #2338

Open
jzwood opened this issue Sep 27, 2024 · 1 comment
Open

Compiler Bug: Pathological example #2338

jzwood opened this issue Sep 27, 2024 · 1 comment

Comments

@jzwood
Copy link

jzwood commented Sep 27, 2024

I ran into a compiler bug while working on my elm app. Below is the offending code as much as possible.

SSCCE

module Main exposing (..)

import Html exposing (text)
import List.Extra exposing (mapAccuml)


main =
    text "Hello!"


func =
    List.Extra.mapAccuml
        (\a b ->
            let
                return : ( Int, x )
                return =
                    ( a, b )
            in
            return
        )
        ( 0, 0 )

dependencies

    "dependencies": {
        "direct": {
            "elm/browser": "1.0.2",
            "elm/core": "1.0.5",
            "elm/html": "1.0.0",
            "elm-community/list-extra": "8.7.0"
        },
  • Elm: 0.19.1
  • Browser: na
  • Operating System: macOs sonoma 14.4.1

Additional Details

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

    x [rank = 2]

Please create an <http://sscce.org/> and then report it
at <https://github.com/elm/compiler/issues>


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

-- 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.

-- REQUEST ---------------------------------------------------------------------

If you are feeling up to it, please try to get your code down to the smallest
version that still triggers this message. Ideally in a single Main.elm and
elm.json file.

From there open a NEW issue at https://github.com/elm/compiler/issues with your
reduced example pasted in directly. (Not a link to a repo or gist!) Do not worry
about if someone else saw something similar. More examples is better!

This kind of error is usually tied up in larger architectural choices that are
hard to change, so even when we have a couple good examples, it can take some
time to resolve in a solid way.elm: thread blocked indefinitely in an MVar operation
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant