Skip to content

Conversation

@jiribenes
Copy link
Contributor

@jiribenes jiribenes commented Nov 14, 2025

An example from @marvinborner:

val l: List[Int] = [1, 2, 3].delete(4)
//                 ^^^^^^^^^^^^^^^^^^^ error: Cannot typecheck call.

This message originates from:

failures match {
case Nil =>
Context.abort("Cannot typecheck call.")

If I understood the code correctly, this triggers iff: at the same time don't succeed in finding an overload, but also don't fail [?!]. In my opinion, writing this at thirty to midnight on a Friday, this is the case where we use UFCS to call a method that does not actually exist, hence the attempt at a better error message.


TODO Needs some neg tests, ideally also a better fix here (can we say anything about the expected type here?).
I'd also appreciate a double-check: Does this actually happen only in the case I've outlined above (i.e. we cannot find any functions with a passing name, much less a passing type?).

@jiribenes jiribenes added errormessage area:typer experiment Experimental branch, do not merge! labels Nov 14, 2025
@jiribenes jiribenes changed the title Experiment: try to improve overload message with 0 failures Improve error when using dot syntax with an undefined function/method Nov 15, 2025
@jiribenes jiribenes removed the experiment Experimental branch, do not merge! label Nov 15, 2025
@jiribenes
Copy link
Contributor Author

According to the Effekt meeting: This needs further investigation, the "0 failures" case probably means something like "we filtered out the failure eagerly, and then therefore didn't give it to this fn".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants