Uploaded image for project: 'CDI Specification Issues'
  1. CDI Specification Issues
  2. CDI-387

Incorrect rule regarding assignability of parameterized types when both bean type parameter and required type parameter are type variables

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • 1.1.PFD, 1.1.FD
    • None
    • None

    Description

      Say we have the following required type:

      Dao<X extends Medium>
      

      and classes:

      class Small {...}
      class Medium extends Small {...}
      class Big extends Medium {...}
      

      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.

      Attachments

        Activity

          People

            marko.luksa@gmail.com Marko Luksa (Inactive)
            marko.luksa@gmail.com Marko Luksa (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: