Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.5.18, 4.0.5, 3.0.13
-
None
Description
Consider the following:
abstract class A<X extends Serializable> { X x } class C<Y extends Serializable> extends A<Y> { } @groovy.transform.TypeChecked def <Z extends Number> C<Z> m(List<Z> list_of_z) { new C(x: list_of_z.first()) // cannot assign Z to variable of type X }
The map-style construction gives improper error for "X x = z". It cannot work out that X is Z in this case.