[
https://issues.apache.org/jira/browse/GROOVY-9440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17059808#comment-17059808
]
Eric Milles commented on GROOVY-9440:
-------------------------------------
[~vampire] You mention that line info is taken from the parent statement.
Before the Spock transform, I see two ExpressionStatement instances for each
test method with full line information. After the Spock global transform, the
methods have been rewritten and expanded quite significantly. Where in those
methods should I be looking for the enclosing statements of "a << [b]" and "a
<< b"?
It appears to me that Groovy is setting up the AST properly, then the Spock
global transform does its thing. At which point, you say the line information
of the two methods differs. Is it not the Spock transform that is the source
of the issue?
> Missing line number information in stack trace
> ----------------------------------------------
>
> Key: GROOVY-9440
> URL: https://issues.apache.org/jira/browse/GROOVY-9440
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 2.5.8, 3.0.0
> Reporter: Björn Kautler
> Priority: Minor
>
> If you try to run these two features in a Spock spec:
> {code:java}
> def foo() {
> expect: true
> where: a << [b]
> }
> def bar() {
> expect: true
> where: a << b
> } {code}
> You will get a {{MissingPropertyException}} for both of them, which is
> perfectly fine.
> The problem is, that for {{foo}} there is a line number in the stack trace
> while for {{bar}} there is not.
> I checked the byte code, there it is also missing for the {{bar}} case.
> According to [~paulk] the line number information is present in the AST:
> {quote}BlockStatement (no info) -> ReturnStatement (no info) -> Variable
> (with line number info) // b
> BlockStatement (no info) -> ReturnStatement (no info) -> ListExp (correct
> info) -> Variable (correct info) // [b]
> {quote}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)