File tree Expand file tree Collapse file tree
base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic
org.codehaus.groovy25/src/org/codehaus/groovy/classgen
org.codehaus.groovy30/src/org/codehaus/groovy/classgen
src/org/codehaus/groovy/classgen Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1754,6 +1754,26 @@ public void testAnonymousInnerClass33() {
17541754 runConformTest (sources );
17551755 }
17561756
1757+ @ Test // GROOVY-7033
1758+ public void testAnonymousInnerClass34 () {
1759+ //@formatter:off
1760+ String [] sources = {
1761+ "Script.groovy" ,
1762+ "new Object() {\n " +
1763+ " @Tag(String) def field\n " +
1764+ " @Tag(String) def method(@Tag(String) param) {\n " +
1765+ " def type = String\n " +
1766+ " }\n " +
1767+ "}\n " ,
1768+
1769+ "Tag.groovy" ,
1770+ "@interface Tag { Class<?> value() }\n " ,
1771+ };
1772+ //@formatter:on
1773+
1774+ runConformTest (sources );
1775+ }
1776+
17571777 @ Test
17581778 public void testMixedModeInnerProperties_GRE597 () {
17591779 //@formatter:off
Original file line number Diff line number Diff line change @@ -569,14 +569,23 @@ public void visitConstructorCallExpression(ConstructorCallExpression call) {
569569 currentScope .setClassScope (innerClass );
570570 currentScope .setInStaticContext (false );
571571 for (MethodNode method : innerClass .getMethods ()) {
572+ // GRECLIPSE add -- GROOVY-7033
573+ visitAnnotations (method );
574+ // GRECLIPSE end
572575 Parameter [] parameters = method .getParameters ();
576+ // GRECLIPSE add -- GROOVY-7033
577+ for (Parameter p : parameters ) visitAnnotations (p );
578+ // GRECLIPSE end
573579 if (parameters .length == 0 )
574580 parameters = null ; // null means no implicit "it"
575581 ClosureExpression cl = new ClosureExpression (parameters , method .getCode ());
576582 visitClosureExpression (cl );
577583 }
578584
579585 for (FieldNode field : innerClass .getFields ()) {
586+ // GRECLIPSE add -- GROOVY-7033
587+ visitAnnotations (field );
588+ // GRECLIPSE end
580589 Expression expression = field .getInitialExpression ();
581590 pushState (field .isStatic ());
582591 if (expression != null ) {
Original file line number Diff line number Diff line change @@ -504,14 +504,23 @@ public void visitConstructorCallExpression(final ConstructorCallExpression expre
504504 currentScope .setClassScope (innerClass );
505505 currentScope .setInStaticContext (false );
506506 for (MethodNode method : innerClass .getMethods ()) {
507+ // GRECLIPSE add -- GROOVY-7033
508+ visitAnnotations (method );
509+ // GRECLIPSE end
507510 Parameter [] parameters = method .getParameters ();
511+ // GRECLIPSE add -- GROOVY-7033
512+ for (Parameter p : parameters ) visitAnnotations (p );
513+ // GRECLIPSE end
508514 if (parameters .length == 0 ) {
509515 parameters = null ; // null means no implicit "it"
510516 }
511517 visitClosureExpression (new ClosureExpression (parameters , method .getCode ()));
512518 }
513519
514520 for (FieldNode field : innerClass .getFields ()) {
521+ // GRECLIPSE add -- GROOVY-7033
522+ visitAnnotations (field );
523+ // GRECLIPSE end
515524 Expression initExpression = field .getInitialExpression ();
516525 pushState (field .isStatic ());
517526 if (initExpression != null ) {
Original file line number Diff line number Diff line change 3535 <file-match-pattern match-pattern =" groovy/ast/expr/RangeExpression.java" include-pattern =" false" />
3636 <file-match-pattern match-pattern =" groovy/ast/expr/(Static)?MethodCallExpression.java" include-pattern =" false" />
3737 <file-match-pattern match-pattern =" groovy/ast/tools/(Expression|Generics)Utils.java" include-pattern =" false" />
38- <file-match-pattern match-pattern =" groovy/classgen/(Annotation|Enum)Visitor.java" include-pattern =" false" />
38+ <file-match-pattern match-pattern =" groovy/classgen/(Annotation|Enum|VariableScope )Visitor.java" include-pattern =" false" />
3939 <file-match-pattern match-pattern =" groovy/classgen/(Extended)?Verifier.java" include-pattern =" false" />
4040 <file-match-pattern match-pattern =" groovy/classgen/asm/WriterController.java" include-pattern =" false" />
4141 <file-match-pattern match-pattern =" groovy/classgen/asm/sc/StaticInvocationWriter.java" include-pattern =" false" />
You can’t perform that action at this time.
0 commit comments