switch tests on new inference

(cherry picked from commit d2cbf3f2833104c3a0381059b0d6ef8ac0b3c94c)
This commit is contained in:
anna
2013-11-25 16:47:38 +01:00
parent 23432e3cd7
commit 481bc252f3
44 changed files with 698 additions and 32 deletions
@@ -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>
}
}
@@ -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>
}
}
@@ -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>
}
}
@@ -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>
}
}