Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.8.1
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
The current implementation expects to be given a ClassExpression for each class to Newify (for the Rubyesque style). Classes defined within the same script won't yet be processed into a ClassExpression but can be found in the source unit. The goal is to make the following work:
import groovy.transform.Immutable abstract class Tree {} @Immutable class Branch extends Tree { Tree left, right } @Immutable class Leaf extends Tree { int val } @Newify([Branch, Leaf]) def t = Branch(Leaf(1), Branch(Branch(Leaf(2), Leaf(3)), Leaf(4))) assert t.toString() == 'Branch(Leaf(1), Branch(Branch(Leaf(2), Leaf(3)), Leaf(4)))'
Activity
Paul King
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Resolution | Fixed [ 1 ] |
Paul King
made changes -
| Resolution | Fixed [ 1 ] | |
| Status | Resolved [ 5 ] | Reopened [ 4 ] |
Paul King
made changes -
| Status | Reopened [ 4 ] | Resolved [ 5 ] |
| Fix Version/s | 1.8.1 [ 17223 ] | |
| Resolution | Fixed [ 1 ] |
Paul King
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |