Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
I have the following program
class A { void foo(I x) {} } interface I {} interface I2 extends I {} class B<T> implements I2 {} class C<T> implements I {} class Main { public static void main(String[] args) { (new A()).foo((true) ? new B<String>() : new C<String>()); } }
Actual behaviour
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: test.groovy: 12: [Static type checking] - Cannot find matching method A#foo(java.lang.Object). Please check if the declared type is correct and if the method exists. @ line 12, column 5. (new A()).foo((true) ? new B<String>() : new C<String>()); ^1 error
Expected behaviour
Compile successfully
Tested against master
Attachments
Issue Links
- is related to
-
GROOVY-10603 LUB operation returns incorrect result
- Closed