Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
I have the following program
class Foo<T> { T foo() { new Bar<T>().f1.f2.f3; } } class Bar<Y> { Baz<Y> f1; } class Baz<T> { Qux<T> f2; } class Qux<X> { X f3; }
Actual behavior
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: test.groovy: 3: [Static type checking] - Cannot return value of type Y on method returning type T @ line 3, column 5. new Bar<T>().f1.f2.f3; ^ 1 error
Expected behavior
Compile successfully
Tested against master (https://github.com/apache/groovy/commit/0e8d0e26e3fe4f8cc21d58f1a1163ae29a8892db)