-
Enhancement
-
Resolution: Unresolved
-
P4
-
8
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).
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).
- relates to
-
JDK-8146039 18.2.1: Don't allow out-of-scope type variables in inference bounds from method references
-
- Closed
-
-
JDK-8016202 Lambda Spec: derive inference constraints from non-overloaded, non-generic method references
-
- Closed
-