Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.2
-
None
Description
interface MyCloseable { void close() } interface OtherCloseable extends MyCloseable { void close() } class MyCloseableChannel implements OtherCloseable {} @groovy.transform.TypeChecked class Test { static void test() { def mc = new MyCloseableChannel() mc.close() } } Test.test()
Here, OtherCloseable redefines close() from MyCloseable, and it seems to confuse the type checker, as it complains with:
[Static type checking] - Cannot find matching method MyCloseableChannel#close(). Please check if the declared type is right and if the method exists.
I found the case with java.nio.Channel which redefines the close() method from parent interface java.io.Closeable.