Jochen Theodorou created GROOVY-9415:
----------------------------------------

             Summary: failure in static compilation with getAt
                 Key: GROOVY-9415
                 URL: https://issues.apache.org/jira/browse/GROOVY-9415
             Project: Groovy
          Issue Type: Bug
          Components: Static Type Checker
            Reporter: Jochen Theodorou


{code:Java}
class l {
  static <T> T getAt(T x) {return x}
}

@groovy.transform.CompileStatic
def m() {
  List<Integer> x =  l[1,2,3]
  return x
}

m()
{code}

this code fails to compile {pre}
[Static type checking] - Cannot find matching method 
java.lang.Class#getAt(java.util.List). Please check if the declared type is 
correct and if the method exists.
 @ line 7, column 22.
     List<Integer> x =  l[1,2,3]
                        ^

1 error
{pre}
The error message makes me think that l is seen as an instance of Class instead 
of the class l. Changing the class name l does not make a difference for me. I 
tested with groovy 3.0.1 and 2.4.7, same error, so unlikely to be new



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

Reply via email to