groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul King (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-5510) Wrong line number for assignment
Date Wed, 03 May 2017 23:36:04 GMT

    [ https://issues.apache.org/jira/browse/GROOVY-5510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15995907#comment-15995907
] 

Paul King commented on GROOVY-5510:
-----------------------------------

It would be nice to merge regularly with master (and merge or backport to GROOVY_2_6_X). I'll
try to give you a hand if I can. I'm wondering whether the line number for assignment issue
is worth an email to the dev list? I agree that what is there now is workable. On the other
hand if we wanted to improve what information is stored, now might be the time to make such
a change.

> Wrong line number for assignment
> --------------------------------
>
>                 Key: GROOVY-5510
>                 URL: https://issues.apache.org/jira/browse/GROOVY-5510
>             Project: Groovy
>          Issue Type: Sub-task
>          Components: parser
>    Affects Versions: 2.0-rc-2
>            Reporter: C├ędric Champeau
>            Assignee: Daniel Sun
>             Fix For: 3.x
>
>
> It seems that annotating declarations breaks the line number of the AST node which is
annotated, replacing it with the line number of the annotation itself.
> Test case:
> {code}
> void testLineNumber() {
>         assertScript '''//1
>             @ASTTest(phase=INSTRUCTION_SELECTION, value= { // 2
>                 assert node.lineNumber == 5 // 3
>             }) // 4
>             int x = 1
>         '''
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message