Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 2.0-beta-3
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
When we develop AST transformations, it is often difficult to check that a particular transformation performs what is necessary. For example, we would like, in type checking, to verify that after the type checker has performed its work, a particular AST node contains metadata about the inferred type. Checking this currently requires compilation trickery which is not user-friendly. We propose to add an AST transformation which allows embedding tests. For example, we could test the @Field AST transformation this way:
import groovy.transform.* @ASTTest(value = { def owner = node.declaringClass assert owner.fields.any { it.name == 'x' } } @Field int x
Activity
Cedric Champeau
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Resolution | Fixed [ 1 ] |
Paul King
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |