Closed mads-hartmann closed 11 years ago
@dragos Probably easiest if you're the one to review this one given that you already know the problem and the solution ;)
@dragos Pushed some changes so it now uses a subclass of Locator
to find the TypeApply
node if it exists. Also improved the inline documentation and tried to make the code a bit more clear
Other than the isEligible
, LGTM!
When asking for the type of a position that contains an invocation of an overloaded method we would sometimes get an overloaded method symbol from the compiler rather than the symbol of the precise method that was being invoked.
The problem is that
askTypeAt
only returns the smallest fully attributed tree that encloses a given position. Consider the following exampleIf the position is at the beginning of the
askOption
identifier (the invocation) then the presentation compiler will only type-check the receiver (the Select node) and not the arguments and thus will not resolve the overloaded method.We fix this by asking the compiler to type-check more of the tree using a RangePosition.
Fixes #38