-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No completions returned on wildcard in method with multiple params #12909
Comments
I think a related broken example is object MultiArg {
def multiArg(f: (Double, Double) => Double): Nothing = ???
multiArg(_.@@)
} Here also, we get no completions after |
Thanks both of you, I hope I'll find some time soon to take a look. |
In the first example
The parser will create an AST The argument is then type checked in the error handler but without an expected type (https://github.com/scala/scala/blob/v2.13.12/src/compiler/scala/tools/nsc/typechecker/Typers.scala#L5064). In type-checking Maybe we can do some more best effor error recovery in interactive mode. So far I couldn't spot a flag or something to know if we're in an The second example might be slightly different, haven't checked yet. |
Thanks for looking into this!
I think we would need to add one, though for Scala 3 I don't think it is used. The tree doesn't matter much if an error is reported anyway, so the whole compilation still fails. |
Yes, but I believe there are some cases where type checking method arguments with an expected type fails, but then typing them without succeeds and compilation continues. So we're not necessarily in an error state yet. |
Reproduction steps
Problem
When trying to get completions after _. we don't get any results. I suspect it's because we are missing all the arguments. This works for one argument function.
I think there was a similar issue in Scala 3, but it could have been fix by Martin in https://github.com/lampepfl/dotty/pull/14695/files
Maybe it would be possible to backport those fixes to Scala 2 ? I think those parts haven't changed much. I will not have time to work on that unfortunately, but I was hoping this could be a quick look from someone more knowledgable about the compiler
The text was updated successfully, but these errors were encountered: