Open jiribenes opened 2 weeks ago
If I'm looking at it correctly, the error message is produced by the body checkAgainst ret
here (and we could use the resumeType
):
https://github.com/effekt-lang/effekt/blob/000a76885d1a1d0004a41422ca35a87362582503/effekt/shared/src/main/scala/effekt/Typer.scala#L470-L482
Students (and many other users like me) often forget to
resume
from a handler. We could customise the error message, especially when it's obvious from the type that usingresume
would fix the type error one gets.Let's take a look at a small example:
We could customise ( 🚲🏠 ) the error to something slightly more specific like:
The heuristic is pretty straightforward: an additional hint should fire if in the handler we get "expected
τ1
but gotτ2
" andresume
has typeτ2 => τ1
.