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
askTypeAt returns overloaded types #7548
Comments
Imported From: https://issues.scala-lang.org/browse/SI-7548?orig=1 |
@vigdorchik said: |
@dragos said: I think the contract is that "askTypeAt" should give you the same type whether the file was fully type-checked or "targeted" type-checked. Right now, if the file was fully type-checked the |
@vigdorchik said: That's a great idea to formalize the contract! What you say is the type returned by targeted type-check (if any) is the same as the type obtained by full type-check, right? |
@dotta said: |
@dotta said: |
@huitseeker said: |
Targeted type-checking in the presentation compiler is sometimes too precise.
askTypeAt(pos)
stops type-checking as soon as the smallest enclosing tree forpos
has been typed. However, for overloaded method calls this is too early, since the type is not known before looking at the arguments.This happens for any overloaded method call.
askTypeAt
should be smarter, and continue type-checking iftree.tpe.isOverloadedType
.Observable outcomes of this (in the IDE) are unknown 'hovers', broken hyperlinking that suddenly starts working, unresolved ScalaDoc comments.
The text was updated successfully, but these errors were encountered: