Improve type mismatch error message by providing hints when the solution might be guessable by the compiler #2083
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
As a concrete example, when someone mutates a field inside a
fun
, the error message doesn't suggest that the solution might be to convert it into aref fun
to accommodate the mutation. Instead you often see errors that complain aboutx
is not a subtype ofy
or that it was looking forthis->x
and it sawx
. These are technically valid error messages, but if the compiler can detect that it's actually just a simple mutability issue, it could provide a hint.The text was updated successfully, but these errors were encountered: