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

18.5.2: Consider lambdas appearing as nested invocation arguments inside other lambdas

XMLWordPrintable

      JDK-8033488 ensured that nested lambdas like the following are considered by the outer invocation's invocation type inference:

      foo(bar(x -> expr))

      However, it did not consider poly method invocations nested inside _other_ lambda expressions:

      foo(y -> bar(x -> expr))

      Assuming 'bar' is a poly method invocation, the lambda expression x->expr can impact the type arguments of 'foo', and thus should be considered as part of the set of constraints 'C', as described in 18.5.2.

      In general, we need to consider all lambda result expressions that are i) poly method invocations, ii) poly class instance creations, or iii) conditionals/parenthesizeds that wrap on of these.

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

              Created:
              Updated:
              Resolved: