Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.5.1Release
-
Fix Version/s: 2.6.0.Release
-
Component/s: Content Assist
-
Labels:None
-
Environment:Eclipse 3.7
-
Number of attachments :
Description
The following will not suggest foo:
(1..10).each {
// foo() not suggested
}
def foo() {
}
however, this will:
def bar = {
// foo() suggested
}
def foo() {
}
Activity
Andrew Eisenberg
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Assignee | Andrew Eisenberg [ werdna ] |
Andrew Eisenberg
made changes -
| Fix Version/s | 2.5.2.Release [ 17434 ] | |
| Affects Version/s | 2.5.1Release [ 17186 ] | |
| Affects Version/s | 2.5.2.Release [ 17434 ] |
Andrew Eisenberg
made changes -
| Fix Version/s | 2.6.0.Release [ 17849 ] | |
| Fix Version/s | 2.5.2.Release [ 17434 ] |
Andrew Eisenberg
made changes -
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Resolution | Fixed [ 1 ] |
The problem here is a confusion with the type of this. Inside the each closure, this is inferred to be of type Integer, but inside the field initializer closure, this is inferred to be the type of the script.
Although that is technically correct, the delegate methods in the each closure (which come from the script) should be available too in content assist.