Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-2818

Relax restrictions on types on Event/Instance injection points

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 6.0.3.Final
    • None
    • None

      Currently, Weld doesn't allow wildcards in IPs with Event or Instance.
      Something like @Inject Instance<?> will result in a validation error coming from ValidatorLogger#injectionPointHasWildcard.

      However, there doesn't seem to be anything in the specification preventing this and, at least for Event, you can basically bypass this already by using Instance.
      I.e. you cannot do @Inject Event<?> but you can do Event<?> event = beanManager.createInstance().select(new TypeLiteral<Event<?>>() {}).get();

      Trying this locally, I saw no issue in the current testsuite either, so we could just remove that.
      FTR, Quarkus Arc allows this as well.

              manovotn Matěj Novotný
              manovotn Matěj Novotný
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: