Uploaded image for project: 'CDI TCK'
  1. CDI TCK
  2. CDITCK-510

FireEventTest.testTypeVariableEventTypeFails() is not valid

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.0.0.Alpha8, 1.2.10.Final
    • 1.2.8.Final, 1.2.9.Final
    • None
    • None

      The spec allows to infer the parameterized type of the event type from the specified type (e.g. Event injection point). See also CDI-256.

      public class Bar {
      
          @Inject
          private Event<Foo<? extends Number>> event;
      
          public <T extends Number> void fireWithTypeVariable() {
              event.fire(new Foo<T>()); // --> this is resolvable
          }
      }
      

              tremes1@redhat.com Tomas Remes
              mkouba@redhat.com Martin Kouba
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: