Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-3472

Wrong line/column numbers for method and closure blocks

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.7
    • Fix Version/s: 2.6.0-alpha-1
    • Component/s: parser
    • Labels:
      None

      Description

      Under certain circumstances code blocks (BlockStatement) of MethodNode and ClosureExpression have just [-1,-1,-1,-1] for line and column numbers, while parent (MethodNode, ClosureExpression) is ok. Sometimes even some statements in the block have [-1,-1,-1,-1] coordinates.

      Sample - method x:

      class GroovyClass {
          def x() {
              String a
      
              
          }
      }
      

      In this situation MethodNode [2,5,6,6], code BlockStatement [-1,-1,-1,-1] , ReturnStatement [-1,-1,-1,-1]

        Activity

        Hide
        paulk Paul King added a comment -

        On trunk I now get:

        MethodNode [2,5,6,6], code BlockStatement [3,9,3,17] , ReturnStatement [3,9,3,17]
        

        Should we close this issue?

        Show
        paulk Paul King added a comment - On trunk I now get: MethodNode [2,5,6,6], code BlockStatement [3,9,3,17] , ReturnStatement [3,9,3,17] Should we close this issue?
        Hide
        blackdrag Jochen Theodorou added a comment -

        maybe we should add a test? I remember we have some line number based tests in the code base

        Show
        blackdrag Jochen Theodorou added a comment - maybe we should add a test? I remember we have some line number based tests in the code base
        Hide
        daniel_sun Daniel Sun added a comment -

        Fixed in the parrot branch

        Show
        daniel_sun Daniel Sun added a comment - Fixed in the parrot branch

          People

          • Assignee:
            daniel_sun Daniel Sun
            Reporter:
            phejl Petr Hejl
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development