Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.4.0
-
None
Description
Create classes.java:
interface I { R[] method(); } interface I2 extends I { R2[] method(); } interface R {} interface R2 extends R {}
compile it with JDK 8 javac.
Then create usage.groovy:
import groovy.transform.CompileStatic @CompileStatic class Gr { R2[] x(I2 i) { return i.method(); } }
Compile it with groovyc (also run with Java8) with the classes from previous compilation in the classpath. Compilation fails:
usage.groovy: 6: [Static type checking] - Reference to method is ambiguous. Cannot choose between [R2[] I2#method(), R[] I2#method()]
@ line 6, column 15.
return i.method();
^
1 error
Originally reported as https://youtrack.jetbrains.com/issue/IDEA-148973
Attachments
Issue Links
- is related to
-
GROOVY-7849 Incompatible covariant array return type
- Closed
- links to