Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.2.1, 2.4.0-beta-3
-
None
-
Groovy Version: 2.2.1 JVM: 1.7.0_40 Vendor: Oracle Corporation OS: Mac OS X
Description
Generic properties do not honour the declared type in the subclass. For example:
@CompileStatic class X<T> { T target } @CompileStatic class Y extends X<InputStream> { def f() { target.read() } }
Reports the following compilation error:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
test.groovy: 14: [Static type checking] - Cannot find matching method java.lang.Object#read(). Please check if the declared type is right and if the method exists.
@ line 14, column 14.
def f() { target.read()