elm / error-message-catalog

A catalog of broken Elm programs / data to improve error messages
BSD 3-Clause "New" or "Revised" License
174 stars 17 forks source link

Subtraction without whitespace gives non-intuitive error #348

Open Strepto opened 3 years ago

Strepto commented 3 years ago

Subtraction is the only operator creating error messages when there is no whitespace in the example below.

maths : Int -> Int
maths a = 
    let
        b = a+a
        c = a-a -- This line will not compile
        d = a//a
        e = a*a
        f = a^a
    in
        1

Will give this error message, confusing me for a few moments.

image

Consider if this should be handled with a specific error message?