Improve error when using dot syntax with an undefined function/method #1206
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
An example from @marvinborner:
This message originates from:
effekt/effekt/shared/src/main/scala/effekt/Typer.scala
Lines 1263 to 1265 in 73e46d2
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?).