[cdi-dev] [JBoss JIRA] (CDI-387) Incorrect rule regarding assignability of parameterized types when both bean type parameter and required type parameter are type variables

Jozef Hartinger (JIRA) jira-events at lists.jboss.org
Wed Jul 17 05:02:26 EDT 2013


     [ https://issues.jboss.org/browse/CDI-387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jozef Hartinger updated CDI-387:
--------------------------------

    Affects Version/s: 1.1.FD

    
> Incorrect rule regarding assignability of parameterized types when both bean type parameter and required type parameter are type variables
> ------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CDI-387
>                 URL: https://issues.jboss.org/browse/CDI-387
>             Project: CDI Specification Issues
>          Issue Type: Bug
>    Affects Versions: 1.1.PFD, 1.1.FD
>            Reporter: Marko Lukša
>
> Say we have the following required type:
> {code}
> Dao<X extends Medium>
> {code}
> and classes:
> {code}
> class Small {...}
> class Medium extends Small {...}
> class Big extends Medium {...}
> {code}
> According to the last bullet of section 5.2.4., 
> bean type {{Dao<X extends Small>}} is assignable to the required type {{Dao<X extends Medium>}}, since the required type parameter and bean type parameter are both type variables and the upper bound of the required type parameter ({{Medium}}) is assignable to the upper bound of the bean type parameter ({{Small}}). 
> On the other hand, according to the same rules, bean type {{Dao<X extends Big>}} is not assignable to required type {{Dao<X extends Medium>}}. 
> It should be the other way around. 
> Bullet 5 should be corrected in the same way bullet 4 was corrected in CDI-85. The upper bound of the required type parameter should be assignable *from* the upper bound of the bean type parameter.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the cdi-dev mailing list