title: Idea. internal java compiler error occurs when I try to assign int to Stream#reduce operation but when Integer - not
body: <p>I have found following strange behaviour of streams</p>
  
  <p>lets research following code:</p>
  
  <pre><code>int summaryAge = Person.getPersons().stream()
                  .parallel()  //will return surprising result
                  .reduce(0, (intermediateResult, p) -&gt; intermediateResult + p.age,
                          (ir1, ir2) -&gt; ir1 + ir2);
  </code></pre>
  
  <p>Idea doesn't highlight any errors but when I run application I see following compilation error:</p>
  
  <pre><code>Error:java: Compilation failed: internal java compiler error
  </code></pre>
  
  <p>but when I replace it using <code>Integer</code> like this:</p>
  
  <pre><code>Integer summaryAge = Person.getPersons().stream()
                      .parallel()  //will return surprising result
                      .reduce(0, (intermediateResult, p) -&gt; intermediateResult + p.age,
                              (ir1, ir2) -&gt; ir1 + ir2);
  </code></pre>
  
  <p>It works properly.</p>
  
  <p>model:</p>
  
  <pre><code>public class Person {
  
      String name;
  
      Integer age;
      ///...
  
      public static Collection&lt;Person&gt; getPersons() {
          List&lt;Person&gt; persons = new ArrayList&lt;&gt;();
          persons.add(new Person("Vasya", 12));
          persons.add(new Person("Petya", 32));
          persons.add(new Person("Serj", 10));
          persons.add(new Person("Onotole", 18));
          return persons;
     }
  }
  </code></pre>
  
  <p>Does it bug of idea or compiler?</p>