Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
Consider the following Gradle build script snippet:
sourceSets { main { java { srcDirs = [] } groovy { srcDirs = ['src/main'] } } test { java { srcDirs = [] } groovy { srcDirs = ['src/test'] } } }
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.