[jira] [Created] (GROOVY-8689) New line between constructor call and {}

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (GROOVY-8689) New line between constructor call and {}

JIRA jira@apache.org
Daniil Ovchinnikov created GROOVY-8689:
------------------------------------------

             Summary: New line between constructor call and {}
                 Key: GROOVY-8689
                 URL: https://issues.apache.org/jira/browse/GROOVY-8689
             Project: Groovy
          Issue Type: Bug
          Components: parser-antlr4
    Affects Versions: 3.0.0-alpha-3
            Reporter: Daniil Ovchinnikov


{code:groovy}
new A()
{}
{code}
is parsed as {{this.(new A())({})}} i.e. method call with constructor call as method expression.
This results in invocation of whatever `#toString()` returns which doesn't make sense.

In older version it was parsed as {{new A().call({})}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)