groovy

row num and col num of error info is not correct

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Won't Fix
  • Affects Version/s: 1.1-rc-1
  • Fix Version/s: 1.1-rc-2
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

run the following code

def a = new 

B()

get the error info:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, Script5: 1: unable to resolve class B
@ line 1, column 9.
1 error

row num should be 3 and the column num should be 1

if the code modifed as

def a = new B()

we will get the same error info:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, Script8: 1: unable to resolve class B
@ line 1, column 9.
1 error

Is the col 9 caculated by the following way?
1def2 3a4 5=6 7new8 9B()

I added the row num to groovy console.(GROOVY-2206), but did not add the col num because of the former reason.

Thanks,
Daniel.Sun

Issue Links

Activity

Hide
Danno Ferrin added a comment -

col number 9 is the beginning of the new expression, rather than the class B inside of the new expression. The expression generating the parse error starts at column number 9, so I am closing this as not a bug. It is a matter of interpretation as to whether the line information should point to the class, or the expression as the error, but since it is not demonstrably wrong, it is not a critical bug.

Show
Danno Ferrin added a comment - col number 9 is the beginning of the new expression, rather than the class B inside of the new expression. The expression generating the parse error starts at column number 9, so I am closing this as not a bug. It is a matter of interpretation as to whether the line information should point to the class, or the expression as the error, but since it is not demonstrably wrong, it is not a critical bug.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: