Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.11
-
None
Description
I have the following program
interface I { int m(int x); } abstract class A implements I { } class B<T> extends A { public int m(int x) { return x + 1; } } public class C<T> extends A { public int m(int x) { return x - 1; } } class Test { void test() { C<String> x = null; int y = 1; ((true) ? x : new B<String>()).m(y); } }
Actual behavior
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: test.groovy: 26: [Static type checking] - Cannot find matching method A#m(int). Please check if the declared type is correct and if the method exists. @ line 26, column 5. ((true) ? x : new B<String>()).m(y); ^ 1 error
Expected behavior
Compile successfully
Tested against master