Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
I have the following program
class A<T> { T m() { return null; } } class B { B(byte x) {} } class C<T> { T x; C(T x) { this.x = x; } } class Test { <T extends A<Byte>> void test() { C<T> a = new C<T>(null); T x = a.x; new B(x.m()); // should type check } }
Actual behavior
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: test.groovy: 23: [Static type checking] - Cannot find matching method B#<init>(java.lang.Object). Please check if the declared type is correct and if the method exists. @ line 23, column 5. new B(x.m()); ^ 1 error
Expected behavior
Compile successfully
Tested against master (commit: ee12bb52381e8f0583c61fc25d43de1f55b80a87)