[tests] prepares Java tests for the language level raise

This commit is contained in:
Roman Shevchenko
2017-03-24 13:09:47 +01:00
parent 05b15f593e
commit 6bd1b92c6e
38 changed files with 129 additions and 166 deletions

View File

@@ -1,27 +1,25 @@
class MyTest {
private static class Foo {
static int foo(int i) { return i; }
}
static Foo foo = new Foo();
static void foo(String s) {}
static void bar(Integer i, Number n) {}
static void bar(Number n, Integer i) {}
void baz(int i) {}
}
class AlienTest {
interface IInt {
int _(int i);
int m(int i);
}
interface IIntInt {
int _(Integer i1, Integer i2);
int m(Integer i1, Integer i2);
}
static {
@@ -35,34 +33,31 @@ class AlienTest {
}
}
class MyTest1 {
interface I1 {
int[] _();
int[] m();
}
interface I2 {
Object _();
}
interface I3 {
char[] _();
}
interface I4 {
boolean _();
interface I2 {
Object m();
}
interface I3 {
char[] m();
}
interface I4 {
boolean m();
}
interface I5 {
Class<? extends MyTest1> _();
Class<? extends MyTest1> m();
}
interface I6 {
Class<MyTest1> _();
Class<MyTest1> m();
}
void foo(Object[] arr) {
I1 c1 = <error descr="Bad return type in method reference: cannot convert java.lang.Object[] to int[]">arr :: clone</error>;
I2 c2 = arr :: clone;