Open hovsater opened 1 year ago
Thanks for reporting this! To set expectations:
Finally, please be patient with the core team. They are trying their best with limited resources.
As far as I can tell, “breaks terminal rendering” is a bit of a red herring. What seems to happen is that line 6 of the error message contains 65532 spaces in a row. Terminals wrap long lines, which in effect results in a very long empty section to scroll through in the middle of the error message.
Here I replaced long sequences of a character like XXXXXXX…
with {X}*42
:
❯ elm make Main.elm 2> output.txt
Detected problems in 1 module.
❯ node -p 'fs.readFileSync("output.txt", "utf8").replace(/(.)\\1{5,}/g, m => `{${m[0]}}*${m.length}`)'
-- NAME CLASH {-}*57 Main.elm
This `case` pattern has multiple `a` variables.
6|{ }*9[ a, a ] -> list
{ }*16^{ }*65532^
How can I know which one you want? Rename one of them!
Random note: 65532 is suspiciously close to 2^16 = 65,536.
As far as I can tell, “breaks terminal rendering” is a bit of a red herring.
You're right. That was probably some unfortunate wording on my part. I've updated the description accordingly. 🙂
Quick Summary:
While working on https://github.com/hovsater/aoc-elm I encountered an error message that produces unexpected output inside a terminal. Specifically the error message seem to emit 65532 spaces in a row as @lydell kindly pointed out in https://github.com/elm/compiler/issues/2302#issuecomment-1502123871. Since the terminal wrap long lines, the result is a very long empty section to scroll through in the middle of the error message.
SSCCE
Additional Details
The problem can be produced when running with the JSON reporter as well (i.e.,
--report=json
).Here's the raw output from the terminal (produced by running
```console Script started on Mon Apr 10 17:12:41 2023$ \033[?2004h~/code/elm-bug $ elm make --output=/dev/null src\ /Main.elm\r$ \033[?2004l\rCompiling ...\rDetected problems in 1 module.\ \r$ \033[36m-- NAME CLASH -------------------------------------\ ---------------- src/Main.elm\033[0m\r$ \r$ This `case` pattern has multiple `a` variables.\r$ \r$ 6| [ a, a ] -> list\r$ \033[91m^\033[0m \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \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\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \033[91m^\033[0m\r$ How can I know which one you want? Rename one of them!\r$ \r$ \033[?2004h~/code/elm-bug $ \033[?2004l\r\r$ exit\r$ $ Script done on Mon Apr 10 17:12:51 2023$ ```script /tmp/output
and then running/tmp/output
throughsed -n 'l'