Closed Janiczek closed 5 years ago
I fixed the root issue with https://github.com/elm/compiler/commit/545b1784695500e822c2d044b6b5ed2ab6689552, so my development build is now producing:
-- TYPE MISMATCH ------------------------------------------------------ temp.elm
This function cannot handle the argument sent through the (|>) pipe:
9| list
10| |> Dict.fromList
^^^^^^^^^^^^^
The argument is:
List ( List Bool, Bool )
But (|>) is piping it to a function that expects:
List ( comparable, v )
Hint: Only ints, floats, chars, strings, lists, and tuples are comparable.
I am going to try to do better on the hint. I think I can get it to specifically mention that Bool
is not comparable, but I'm not sure!
I tried making the hint really extra specific, but I ended up needing to rewrite some code that would be a bit too risky to change this close to a release. I ended up with some logic that should improve the hints on comparable clashes, but not in cases where a comparable
constraint is having trouble with a type within a list or tuple.
Anyway, thank you for reporting the error here!
I think this
The argument is:
List ( List Bool, Bool )
But (|>) is piping it to a function that expects:
List ( comparable, v )
solves the most urgent problems with the original message :) Thanks!
https://ellie-app.com/48nbR8SGTZ8a1
:arrow_down:
When I change the
List Bool
to something else (eg.String
), the error goes away. This makes me think it doesn't likeList Bool
as a key type for theDict
- possibly something aboutcomparable
? The error message is confusing and seems unrelated though.