Elm Exactly
Results / elm-error-catalogue /

ErrorMessage2012NameClashCaretSpacesTest

Tags:elm19-bug-fixerror-message

elm-0.19.1 failelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass

Issue: elm/compiler#2012

The NAME CLASH report underlines with the wrong carets and hundreds of trailing spaces.

<https://github.com/elm/compiler/issues/2012>

For `f x x =` the report should underline both `x`s (`^ ^` under columns 3 and 5). Elm 0.19.1
prints a single `^` under the wrong column followed by a long run of spaces.

Fixed in Elm 0.19.2.

Results

elm-0.19.1

fail
Missing pattern: ^ ^
--- compiler output ---
Compiling ...-- NAME CLASH ----------------- src/ErrorMessage2012NameClashCaretSpacesTest.elm

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

23| f x x =
        ^                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              

elm-0.19.2

pass
Output
Compiling ...-- NAME CLASH ----------------- src/ErrorMessage2012NameClashCaretSpacesTest.elm

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

22| f x x =
      ^ ^
How can I know which one you want? Rename one of them!

Detected problems in 1 module.

elm-0.19.3

pass
Output
Compiling ...-- NAME CLASH ----------------- src/ErrorMessage2012NameClashCaretSpacesTest.elm

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

22| f x x =
      ^ ^
How can I know which one you want? Rename one of them!

Detected problems in 1 module.

lamdera-1.5.0

pass
Output
Detected problems in 1 module.
-- NAME CLASH ----------------- src/ErrorMessage2012NameClashCaretSpacesTest.elm

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

22| f x x =
      ^ ^
How can I know which one you want? Rename one of them!

Discussions

Discuss this test·Search the discussions on GitHub

Discussions are on GitHub; one about this test has [t:elm-error-catalogue/ErrorMessage2012NameClashCaretSpacesTest] in its title.

Source

The -- CHECK: lines give the expected output.

module ErrorMessage2012NameClashCaretSpacesTest exposing (..)
{-| The NAME CLASH report underlines with the wrong carets and hundreds of trailing spaces.
<https://github.com/elm/compiler/issues/2012>
For `f x x =` the report should underline both `x`s (`^ ^` under columns 3 and 5). Elm 0.19.1
prints a single `^` under the wrong column followed by a long run of spaces.
Fixed in Elm 0.19.2.
-}
-- TAGS: elm19-bug-fix, error-message
-- COMPILE-ERROR: duplicate argument x
-- CHECK: -- NAME CLASH -
-- CHECK: ^ ^
-- CHECK-NOT: {{\^\s\s\s\s\s\s\s\s\s\s}}
import Html
f x x =
x
main =
Html.text ""