Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8016203

18.2.1: Derive inference constraints from non-overloaded generic method references

XMLWordPrintable

      A reference to a generic method, without explicit type arguments, is always inexact, even if the method is not overloaded (15.13.1). This can be surprising, and we may be able to do better -- performing inference for the method reference during overload resolution of an enclosing method call.

      Specifically, when a method is not overloaded and generic, we can introduce new ivars in order to infer appropriate constraints that involve the ivars of both the outer invocation and nested reference.

      We can similarly support inference for method references that belong to generic types but require their type arguments to be inferred (e.g., Pair::getFirst).

            dlsmith Dan Smith
            dlsmith Dan Smith
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: