title: Compilation error while wrapping method throwing exception
body: <p>Checked exceptions wrapped to throw Runtime exception in streams is failing with compilation error in JDK 11 and 12.</p>
  
  <pre><code>package com.mmk.test;
  
  import java.net.URL;
  import java.util.ArrayList;
  import java.util.function.Function;
  
  public class App {
      public static void main(String[] args) {
          var list = new ArrayList&lt;String&gt;();
          list.add("http://foo.com");
          list.stream().map(wrap(url -&gt; new URL(url)));
      }
  
      static &lt;T, R, E extends Throwable&gt; Function&lt;T, R&gt;
      wrap(FunException&lt;T, R, E&gt; fn) {
          return t -&gt; {
              try {
              return fn.apply(t);
              } catch (Throwable throwable) {
                  throw new RuntimeException(throwable);
              }
          };
      }
  
      interface FunException&lt;T, R, E extends Throwable&gt; {
          R apply(T t);
      }
  }
  </code></pre>
  
  <p>Expected: No compilation error and no output.
  Actual: Compilation error, Unhandled Exception.</p>