compiler icon indicating copy to clipboard operation
compiler copied to clipboard

Compiler outputs pages of whitespace in middle of 'name clash' error report

Open coreygirard opened this issue 5 years ago • 2 comments

Quick Summary: The compiler outputs pages of whitespace in the middle of reporting a name clash error

SSCCE

Source

type T
    = T Int


break : T -> T -> T
break a b =
    case ( a, b ) of
        ( T t, T t ) ->
            T 0

Expected output

Detected problems in 1 module.
-- NAME CLASH ------------------------------------------- src/Tree.elm

This `case` pattern has multiple `t` variables.

123|         ( T t, T t ) ->
                 ^    ^
How can I know which one you want? Rename one of them!

Received output

Detected problems in 1 module.
-- NAME CLASH ------------------------------------------- src/Tree.elm

This `case` pattern has multiple `t` variables.

123|         ( T t, T t ) ->
                      ^                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             

[literally tens of thousands of whitespace characters]

      ^
How can I know which one you want? Rename one of them!
  • Elm: 0.19.1
  • Browser: N/A
  • Operating System: MacOS 10.14.6

coreygirard avatar Oct 29 '20 02:10 coreygirard

Very strange! Great SSCCE. Will circle back to this for the next compiler release.

evancz avatar Feb 03 '21 21:02 evancz

Just came across similar behavior in simpler contexts:

f =
    \t t -> 0
Detected problems in 1 module.
-- NAME CLASH -------------------------------------- src/Filename.elm

This anonymous function has multiple `t` arguments.

234|     \t t -> 0
            ^

[tens of thousands of whitespace characters]

         ^
How can I know which one you want? Rename one of them!

f t t = 0
Detected problems in 1 module.
-- NAME CLASH -------------------------------------- src/Filename.elm

The `f` function has multiple `t` arguments.

233| f t t =
         ^

[tens of thousands of whitespace characters]

         ^
How can I know which one you want? Rename one of them!

coreygirard avatar Dec 27 '23 00:12 coreygirard