Eric Milles created GROOVY-11642:
------------------------------------

             Summary: source offset of inner class declaration with annotation
                 Key: GROOVY-11642
                 URL: https://issues.apache.org/jira/browse/GROOVY-11642
             Project: Groovy
          Issue Type: Bug
          Components: parser-antlr4
            Reporter: Eric Milles


Consider the following:
{code:groovy}
class Outer {
  @Deprecated
  public class Inner {
  }
}
{code}

Under the old parser, the source range for {{Inner}} starts at the annotation.  
The new parser starts at the line and column of the {{class}} keyword.  You can 
compare against how an outer class with an annotation gets ranged.

This line does not expand the source range using {{ctx}} as is done for an 
outer class.  
https://github.com/apache/groovy/blob/1eeb735e303fdb230feb03ea3b3f44f7e7750e66/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java#L1584

It is possible that the other member options -- method, field and compact 
constructor -- also fail to include the range of other annotations / modifiers. 
 I have not checked, but it looks suspect.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to