[
https://issues.apache.org/jira/browse/GROOVY-10787?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King closed GROOVY-10787.
------------------------------
> STC: parameterized property check during map-style construction
> ---------------------------------------------------------------
>
> Key: GROOVY-10787
> URL: https://issues.apache.org/jira/browse/GROOVY-10787
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Affects Versions: 2.5.18, 4.0.5, 3.0.13
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
> Fix For: 2.5.19, 4.0.6, 3.0.14
>
>
> Consider the following:
> {code:groovy}
> 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
> }
> {code}
> The map-style construction gives improper error for "X x = z". It cannot
> work out that X is Z in this case.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)