title: Inferred type does not conform to equality constraint error for unrelated variables
body: <p>I have the following piece of code</p>
  
  <pre><code>public class TeeingCollector {
  
      public static void main(String[] args) {
          //        var strs = List.of("abc");
          var dividedStrings = Stream.of("foo", "hello", "bar", "world")
              .collect(Collectors.teeing(
                          Collectors.filtering((String s) -&gt; s.length() &lt;= 3, Collectors.toList()),
                          Collectors.filtering((String s) -&gt; s.length() &gt; 3, Collectors.toList()),
                          List::of
                          ));
          System.out.println(dividedStrings);
      }
      private static class Employee {
          boolean isActive;
  
          public Employee(boolean isActive) {
              this.isActive = isActive;
          }
  
          public boolean isActive() {
              return isActive;
          }
  
          @Override
              public String toString() {
                  return "Employee{" +
                      "isActive=" + isActive +
                      '}';
              }
      }
      private static class MaxMin {
          int max;
          int min;
  
          MaxMin(int max, int min) {
              this.max = max;
              this.min = min;
          }
  
          @Override
              public String toString() {
                  return "MaxMin{" +
                      "max=" + max +
                      ", min=" + min +
                      '}';
              }
      }
  }
  </code></pre>
  
  <p>If I execute that class from terminal with <code>java src/TeeingCollector.java</code>
  I get the following error:</p>
  
  <pre><code>src/TeeingCollector.java:14: error: incompatible types: inferred type does not conform to equality constraint(s)
              .collect(Collectors.teeing(
                      ^
  inferred: List&lt;String&gt;
  equality constraints(s): List&lt;Object&gt;,R
  where R,T,A are type-variables:
  R extends Object declared in method &lt;T,A,R&gt;filtering(Predicate&lt;? super T&gt;,Collector&lt;? super T,A,R&gt;)
  T extends Object declared in method &lt;T,A,R&gt;filtering(Predicate&lt;? super T&gt;,Collector&lt;? super T,A,R&gt;)
  A extends Object declared in method &lt;T,A,R&gt;filtering(Predicate&lt;? super T&gt;,Collector&lt;? super T,A,R&gt;)
  1 error
  error: compilation failed
  </code></pre>
  
  <p>If I uncomment the line <code>var strs = List.of("abc");</code> then the code is executed without any problem.</p>
  
  <p>Java version (for macOS):</p>
  
  <pre><code>OpenJDK Runtime Environment (build 12+33)
  OpenJDK 64-Bit Server VM (build 12+33, mixed mode, sharing)
  </code></pre>
  
  <p>running the same code with the following version (older) yields no errors</p>
  
  <pre><code>OpenJDK Runtime Environment (build 12-ea+23)
  OpenJDK 64-Bit Server VM (build 12-ea+23, mixed mode, sharing)
  </code></pre>
  
  <p><strong>Note:</strong> if I compile it then run, I don't have any errors with both builds for macOS, so it seems that only <code>java TeeingCollector.java</code> isn't working properly</p>