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

Issue with extensible records and unit type #2314

Open
JonathanLorimer opened this issue Oct 26, 2023 · 1 comment
Open

Issue with extensible records and unit type #2314

JonathanLorimer opened this issue Oct 26, 2023 · 1 comment

Comments

@JonathanLorimer
Copy link

JonathanLorimer commented Oct 26, 2023

Quick Summary: I got a very confusing error when I applied an extensible record to a unit type. Obviously this is wrong, but better compiler info about where the error is would be great!

SSCCE

module Issue exposing (..)

type alias ExtRec a =
    { a | foo : Int }

type alias Model = ()

f : ExtRec Model
f = Debug.todo "implement"
  • Elm: 0.19.1
  • Browser: Not in browser
  • Operating System: NixOS 23.11.20230830.a63a64b (Tapir) x86_64

Additional Details

Full error message

Compiling ...+-------------------------------------------------------------------------------
|  Corrupt File: /path/to/repo/elm-stuff/0.19.1/Issue.elmi
|   Byte Offset: 0
|       Message: not enough bytes
|
| Please report this to https://github.com/elm/compiler/issues
| Trying to continue anyway.
+-------------------------------------------------------------------------------

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.

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

@github-actions
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