| edit: please don't downvote finnyspade into the negatives, that's not helpful > The hint is off, but the actual error is super useful. I completely disagree. The actual error is very basic and only useful if you already know what it pertains to, that the hint be way off is actively harmful. > TL;DR Nothing to see here, just a case of "let me google that for you" No, it's a case of the compiler not helping and just dumping the raw error in your lap, let's not settle for being GCC when we can do better: http://elm-lang.org/blog/compilers-as-assistants You shouldn't need to google a bloody traits bound error (and may not even be able to, because you're trying Rust on a bus during your commute and have run out of data) (note that the rustc --explain output doesn't quite help either, it also assumes you already understand trait bounds and also suggests implementing the relevant trait on your type, which is the other way around from the issue, a careful read of the code snippets may hint at the solution, but the explanation doesn't point to it) |
The error is really solid at showing a type mismatch. Which is of the form "I wanted X but you gave me Y".
> that the hint be way off is actively harmful That's true and they could probably do a bit better for type mismatches on type variables vs concrete types
> just dumping the raw error What's the difference between a "raw error" and something else. If the hint was accurate would it still be a "raw error" because it's not styled like those elm errors? Any more info (aside from a better hint which I concede should be better) would have to be an actual explanation of static typechecking which seems a bit extreme.
All I'm saying is while this error isn't a paragon of what all good error messages should be, it's no more cryptic than any other similar error. Even the nicely formatted elm errors say essentially the same thing.