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

Eric Milles updated GROOVY-11677:
---------------------------------
    Language: groovy

> variable and method with same name creates compile error trying to "call" 
> variable name
> ---------------------------------------------------------------------------------------
>
>                 Key: GROOVY-11677
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11677
>             Project: Groovy
>          Issue Type: Improvement
>          Components: Static compilation
>    Affects Versions: 5.0.0-alpha-12
>            Reporter: Saravanan
>            Priority: Major
>
> {code:java}
> public class SomeClass {
>     public List<String> names() {
>         return new ArrayList<>();
>     }
>     public void printNames(List<String> names) {
>         System.out.println(names);
>         System.out.println(names());
>     }
> }{code}
> Compiling this code with @CompileStatic will result in this compile error
> {noformat}
> testdata/plugins/records/RecordTesting.java: 18: [Static type checking] - 
> Cannot find matching method java.util.List#call(). Please check if the 
> declared type is correct and if the method exists.
>  @ line 18, column 28.
>            System.out.println(names());
>                               ^1 error
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to