Minor race condition in line order of compiler error output

Open
#352 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
haskell
Domain
compilers

Research direction

Reproduce the issue by repeatedly compiling the reported Gren 0.6.3 example and compare the compiler error output ordering. Trace how the type annotation and “Detected problems” messages are emitted; done means the complete diagnostic remains in the correct order across repeated compilations.

Written by the indexing model from the issue text.

Description

bug

I'm using Gren 0.6.3.

I have some code here that outputs the following error message:

Compiling (3)-- TYPE MISMATCH ---------------------------------------------- src/App/Cmd.gren

Something is off with the body of the `printLine` definition:

20|     Stream.write toStream
        ^^^^^^^^^^^^^^^^^^^^^
This `write` call produces:

    Stream.Writable (Stream.Writable Bytes)
    -> Task.Task Stream.Error (Stream.Writable (Stream.Writable Bytes))

But the type annotation on `printLine` says it should be:

    Cmd Msg

Detected problems in 1 module.

But when I repeatedly attempt the compilation, the message sometimes looks like this:

Compiling (3)-- TYPE MISMATCH ---------------------------------------------- src/App/Cmd.gren

Something is off with the body of the `printLine` definition:

20|     Stream.write toStream
        ^^^^^^^^^^^^^^^^^^^^^
This `write` call produces:

    Stream.Writable (Stream.Writable Bytes)
    -> Task.Task Stream.Error (Stream.Writable (Stream.Writable Bytes))

Detected problems in 1 module.
 the type annotation on `printLine` says it should be:

    Cmd Msg

The "Detected problems ..." line is out of place. No big deal, but I thought I'd mention it.

Dominant language
Haskell
Stars
503
Forks
29
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from gren-lang/compiler

All issues in gren-lang/compiler

Similar issues

More Haskell issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.