Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: 2.8.0.Release
-
Component/s: Compiler Integration
-
Labels:
-
Environment:Eclipse 3.7; Groovy-Eclipse plugin Version: 2.5.1.xx-20110628-1600-e37
-
Number of attachments :
Description
The following code:
import groovy.transform.Field
@Field List awe = [1, 2, 3]
def awesum() { awe.sum() }
assert awesum() == 6
leads to error in the editor: 'Groovy:Error: annotation @Field can only be used within a Script body.'. When creating Groovy Class, I marked 'Create Script' checkbox.
Issue Links
- depends upon
-
GRECLIPSE-1179
Selectively run "safe" ast transforms as part of a reconcile operation
-
Activity
Andrew Eisenberg
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Link |
This issue depends upon |
Andrew Eisenberg
made changes -
| Labels | web |
Andrew Eisenberg
made changes -
| Component/s | Compiler Integration [ 14686 ] |
Andrew Eisenberg
made changes -
| Labels | web | wish |
Andrew Eisenberg
made changes -
| Labels | wish | stability |
Andrew Eisenberg
made changes -
| Fix Version/s | 2.8.0.Release [ 18618 ] |
Andrew Eisenberg
made changes -
| Assignee | Andrew Eisenberg [ werdna ] |
I am not seeing the editor problem that you are. I am running on the latest dev snapshot where things may have changed a bit. However, in the editor an in the inferencing engine, the @Field transform has not been applied. Currently, this is by design since there are many transforms out there that are not well behaved (such as @Lazy). Applying them in the editor will break editing functionality. We are considering a way to selectively run some transforms in the editor. See
GRECLIPSE-1179.That being said, is the compiler problem that you are seeing only appearing in the editor or do you see it in the problems view as well?