[
https://issues.apache.org/jira/browse/GROOVY-9415?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-9415:
--------------------------------
Fix Version/s: 4.0.5
(was: 5.0.0-alpha-1)
> 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
> Assignee: Eric Milles
> Priority: Major
> Fix For: 4.0.5
>
>
> {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.20.10#820010)