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
@@ -13,7 +13,7 @@ class Foo<R> {
public void foo() {
reduce(Moo::new);
reduce<error descr="'reduce(Foo.Factory<Foo.ASink>)' in 'Foo' cannot be applied to '(<method reference>)'">(AMoo::new)</error>;
<error descr="Inferred type 'Foo<R>.AMoo' for type parameter 'S' is not within its bound; should implement 'Foo.ASink<java.lang.Object,Foo<R>.AMoo>'">reduce(AMoo::new)</error>;
reduce(AAMoo::new);
reduce(AAAMoo::new);
}
@@ -27,7 +27,7 @@ class MyTest<E> {
bar(MyTest<String>::new, "");
bar(MyTest::new, "");
bar(<error descr="Cyclic inference">MyTest::new</error>);
bar(<error descr="Cyclic inference">MyTest<String>::new</error>);
bar(MyTest::new);
bar(MyTest<String>::new);
}
}
@@ -5,7 +5,7 @@ class Test {
static void test() {
Integer next = map(String::length).iterator().next();
Integer next1 = map(Test::length).iterator().next();
<error descr="Incompatible types. Found: 'java.lang.Object', required: 'java.lang.Integer'">Integer next1 = map(Test::length).iterator().next();</error>
}
public static <T> T length(T s) {
@@ -20,7 +20,7 @@ class MyTest {
static void foo(I3 i) {}
static {
foo<error descr="Cannot resolve method 'foo(<method reference>)'">(MyTest::m)</error>;
foo<error descr="Ambiguous method call: both 'MyTest.foo(I1)' and 'MyTest.foo(I2)' match">(MyTest::m)</error>;
foo<error descr="Ambiguous method call: both 'MyTest.foo(I1)' and 'MyTest.foo(I2)' match">(MyTest::m1)</error>;
}
}
@@ -39,6 +39,6 @@ class MyTest1 {
static void foo(I3 i) {}
static {
foo<error descr="Cannot resolve method 'foo(<method reference>)'">(Foo::new)</error>;
foo<error descr="Ambiguous method call: both 'MyTest1.foo(I1)' and 'MyTest1.foo(I2)' match">(Foo::new)</error>;
}
}