mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
switch tests on new inference
(cherry picked from commit d2cbf3f2833104c3a0381059b0d6ef8ac0b3c94c)
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@ class Test {
|
||||
<K extends Throwable> void foo(F<K> f) throws K { }
|
||||
|
||||
{
|
||||
<error descr="Unhandled exception: java.lang.Throwable">foo((t)->{});</error>
|
||||
foo((t)->{});
|
||||
<error descr="Unhandled exception: java.lang.ClassNotFoundException">foo((ClassNotFoundException t)->{});</error>
|
||||
}
|
||||
}
|
||||
+4
-1
@@ -1,11 +1,13 @@
|
||||
class Test {
|
||||
import java.io.IOException;
|
||||
|
||||
class Test {
|
||||
interface F<T extends Throwable> {
|
||||
void _() throws T;
|
||||
}
|
||||
|
||||
void m1() { }
|
||||
void m2() throws NullPointerException{ }
|
||||
void m3() throws IOException { }
|
||||
<K extends Throwable> void foo(F<K> f) throws K { }
|
||||
|
||||
{
|
||||
@@ -14,6 +16,7 @@ class Test {
|
||||
|
||||
foo(this::m1);
|
||||
foo(this::m2);
|
||||
<error descr="Unhandled exception: java.io.IOException">foo(this::m3);</error>
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -5,6 +5,6 @@ class Test {
|
||||
<K extends ClassNotFoundException> void foo(F<K> f) throws K { }
|
||||
|
||||
{
|
||||
<error descr="Unhandled exception: K">foo(() -> {});</error>
|
||||
<error descr="Unhandled exception: java.lang.ClassNotFoundException">foo(() -> {});</error>
|
||||
}
|
||||
}
|
||||
+6
-6
@@ -12,18 +12,18 @@ class Test {
|
||||
<K extends ClassNotFoundException> void foo2(F<K> f) throws K { }
|
||||
|
||||
{
|
||||
<error descr="Inferred type 'java.lang.RuntimeException' for type parameter 'K' is not within its bound; should extend 'java.lang.ClassNotFoundException'">foo2(()->{})</error>;
|
||||
foo2(()->{ <error descr="Unhandled exception: java.lang.ClassNotFoundException">throw new ClassNotFoundException();</error> });
|
||||
<error descr="Unhandled exception: java.lang.ClassNotFoundException">foo2(()->{});</error>
|
||||
<error descr="Unhandled exception: java.lang.ClassNotFoundException">foo2(()->{ throw new ClassNotFoundException(); });</error>
|
||||
|
||||
<error descr="Inferred type 'java.lang.RuntimeException' for type parameter 'K' is not within its bound; should extend 'java.lang.ClassNotFoundException'">foo2(this::m1)</error>;
|
||||
foo2(<error descr="Unhandled exception: java.lang.ClassNotFoundException">this::m2</error>);
|
||||
<error descr="Unhandled exception: java.lang.ClassNotFoundException">foo2(this::m1);</error>
|
||||
<error descr="Unhandled exception: java.lang.ClassNotFoundException">foo2(this::m2);</error>
|
||||
|
||||
|
||||
|
||||
foo1(()->{ <error descr="Unhandled exception: java.lang.ClassNotFoundException">throw new ClassNotFoundException();</error> });
|
||||
foo1(()->{ <error descr="Unhandled exception: java.lang.Exception">throw new Exception();</error> });
|
||||
|
||||
foo1(<error descr="Unhandled exception: java.lang.ClassNotFoundException">this::m2</error>);
|
||||
foo1(<error descr="Unhandled exception: java.lang.Exception">this::m3</error>);
|
||||
<error descr="Unhandled exception: java.lang.ClassNotFoundException">foo1(this::m2);</error>
|
||||
<error descr="Unhandled exception: java.lang.Exception">foo1(this::m3);</error>
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user