You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2020/09/15 03:44:00 UTC

[jira] [Resolved] (GROOVY-9691) Method call "main" is replaced with StaticMethodCallExpression in script

     [ https://issues.apache.org/jira/browse/GROOVY-9691?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul King resolved GROOVY-9691.
-------------------------------
    Fix Version/s: 3.0.6
                   4.0.0-alpha-1
       Resolution: Fixed

> Method call "main" is replaced with StaticMethodCallExpression in script
> ------------------------------------------------------------------------
>
>                 Key: GROOVY-9691
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9691
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Minor
>             Fix For: 4.0.0-alpha-1, 3.0.6
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Consider the following Gradle build script snippet:
> {code:groovy}
> sourceSets {
>     main {
>         java { srcDirs = [] }
>         groovy { srcDirs = ['src/main'] }
>     }
>     test {
>         java { srcDirs = [] }
>         groovy { srcDirs = ['src/test'] }
>     }
> }
> {code}
> When opened in an editor, Groovy transforms "main" to a reference to "static void main(String[])".  This negatively impacts the editing experience because Closure is not a match for String and the IDE gets quite confused.
> This applies to any script (or class with a static main method) that uses "main" as a method call within a closure.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)