Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.6.0.Release
-
Fix Version/s: 2.6.1.Release
-
Component/s: Compiler Integration
-
Labels:None
-
Number of attachments :
Description
Currently, the way that we perform inferencing inside of closures is incorrect. We set the this variable to be the type that seems like an appropriate value for delegate. This means that we loose super-type information (see GRECLIPSE-1317). It also means that we can't easily solve GRECLIPSE-1298. And a variant of GRECLIPSE-1297 becomes possible.
Committed the fix.
Now, the inferencing engine behaves more closely to the way that groovy actually works.
When entering a closure, this is unchanged. delegate is set to the declaring type of the enclosing method call, or this if there is none. owner is set to this if there is no nested closure or groovy.lang.Closure if there is.
And when searching for the declaration of an identifier, first we look at the declarations on delegate and its hierarchy, if it exists, and then we move to this and its hierarchy.