Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-8917

Failed to infer parameter type of some SAM, e.g. BinaryOperator

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0-alpha-4
    • Component/s: None
    • Labels:
      None

      Description

              import groovy.transform.CompileStatic
              import java.util.stream.Collectors
              import java.util.stream.Stream
              
              @CompileStatic
              public class Test1 {
                  public static void main(String[] args) {
                      p();
                  }
                  
                  public static void p() {
                      // If we do not explicitly declare the type of parameter, STC fails
                      assert 13 == [1, 2, 3].stream().reduce(7, (Integer r, Integer e) -> r + e);
                  }
              }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                daniel_sun Daniel Sun
                Reporter:
                daniel_sun Daniel Sun
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: