Renamed test data folder

This commit is contained in:
Valentin Kipyatkov
2015-09-23 16:08:30 +03:00
parent ade9cbcafb
commit c8b6db4e57
57 changed files with 342 additions and 342 deletions
@@ -0,0 +1,7 @@
public class AAA {
private final int x = 42;
public int getX() {
return this.x;
}
}
@@ -0,0 +1,3 @@
class AAA {
val x = 42
}
@@ -0,0 +1,20 @@
interface I {
int getX();
void setX(int x);
}
class A implements I {
private int x;
public A(int x) {
this.x = x;
}
public int getX() {
return x;
}
public void setX(int x){
this.x = x;
}
}
@@ -0,0 +1,5 @@
internal interface I {
var x: Int
}
internal class A(override var x: Int) : I
@@ -0,0 +1,14 @@
public class X {
void foo() {
Runnable runnable = new Runnable() {
int f = 10;
int getValue() { return f; }
@Override
public void run() {
System.out.println(getValue());
}
};
}
}
@@ -0,0 +1,11 @@
class X {
internal fun foo() {
val runnable = object : Runnable {
internal var value = 10
override fun run() {
println(value)
}
}
}
}
@@ -0,0 +1,7 @@
public class AAA {
private int x = 42;
public void setX(int x) {
this.x = x;
}
}
@@ -0,0 +1,7 @@
class AAA {
private var x = 42
fun setX(x: Int) {
this.x = x
}
}
@@ -0,0 +1,28 @@
public class Test {
private String id;
private String name;
private int myAge;
public Test(String id, String name, int anAge) {
this.id = id;
this.name = name;
myAge = anAge;
System.out.println(anAge);
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public int getAge() {
return myAge;
}
}
@@ -0,0 +1,6 @@
class Test(var id: String?, val name: String, val age: Int) {
init {
println(age)
}
}
@@ -0,0 +1,15 @@
public class Test {
private int myCount;
public Test(int count) {
myCount = count;
}
public int getCount() {
return myCount;
}
public void inc() {
myCount++;
}
}
@@ -0,0 +1,12 @@
class Test(count: Int) {
var count: Int = 0
private set
init {
this.count = count
}
fun inc() {
count++
}
}
@@ -0,0 +1,13 @@
public class AAA {
private int myX = 42;
public int getX() {
return myX;
}
public void foo(AAA other) {
System.out.println(myX);
System.out.println(other.myX);
myX = 10;
}
}
@@ -0,0 +1,10 @@
class AAA {
var x = 42
private set
fun foo(other: AAA) {
println(x)
println(other.x)
x = 10
}
}
@@ -0,0 +1,15 @@
public class C {
private final int myX;
public int getX() {
return myX;
}
C(C c, int x){
myX = x;
}
C(C c){
this(c, c.myX);
}
}
@@ -0,0 +1 @@
class C @JvmOverloads internal constructor(c: C, val x: Int = c.x)
@@ -0,0 +1,17 @@
public class Base {
protected int myX = 42;
public int getX() {
return myX;
}
Base(int x){
myX = x;
}
}
class Derived extends Base {
Derived(Base b) {
super(b.myX);
}
}
@@ -0,0 +1,10 @@
open class Base internal constructor(x: Int) {
var x = 42
protected set
init {
this.x = x
}
}
internal class Derived(b: Base) : Base(b.x)
@@ -0,0 +1,20 @@
public class AAA {
protected int myX = 42;
public int getX() {
return myX;
}
public void foo(AAA other) {
System.out.println(myX);
System.out.println(other.myX);
myX = 10;
}
}
class BBB extends AAA {
void bar() {
System.out.println(myX);
myX = 10;
}
}
@@ -0,0 +1,17 @@
open class AAA {
var x = 42
protected set
fun foo(other: AAA) {
println(x)
println(other.x)
x = 10
}
}
internal class BBB : AAA() {
fun bar() {
println(x)
x = 10
}
}
@@ -0,0 +1,7 @@
public class AAA {
private final int x = 42;
public int getX() {
return x;
}
}
@@ -0,0 +1,3 @@
class AAA {
val x = 42
}
@@ -0,0 +1,11 @@
public class AAA {
private int x = 42;
public int getX() {
return x;
}
public void setX(int x) {
this.x = x;
}
}
@@ -0,0 +1,3 @@
class AAA {
var x = 42
}
@@ -0,0 +1,11 @@
public class AAA {
private int x = 42;
public int getX() {
return x;
}
public void foo() {
x = 10;
}
}
@@ -0,0 +1,8 @@
class AAA {
var x = 42
private set
fun foo() {
x = 10
}
}
@@ -0,0 +1,8 @@
public class AAA {
private int x = 42;
private AAA other = new AAA();
public int getX() {
return other.x;
}
}
@@ -0,0 +1,8 @@
class AAA {
private val x = 42
private val other = AAA()
fun getX(): Int {
return other.x
}
}
@@ -0,0 +1,11 @@
public class AAA {
private int x = 42;
public int getX() {
return x;
}
public void setX(int x) {
this.x += x;
}
}
@@ -0,0 +1,6 @@
class AAA {
var x = 42
set(x: Int) {
this.x += x
}
}
@@ -0,0 +1,35 @@
class C {
final int myArg1;
int myArg2;
int myArg3;
C(int arg1, int arg2, int arg3) {
this(arg1);
myArg2 = arg2;
myArg3 = arg3;
}
C(int arg1, int arg2) {
this(arg1);
myArg2 = arg2;
myArg3 = 0;
}
C(int arg1) {
myArg1 = arg1;
myArg2 = 0;
myArg3 = 0;
}
int getArg1() {
return myArg1;
}
int getArg2() {
return myArg2;
}
int getArg3() {
return myArg3;
}
}
@@ -0,0 +1,19 @@
internal class C(val arg1: Int) {
var arg2: Int = 0
var arg3: Int = 0
constructor(arg1: Int, arg2: Int, arg3: Int) : this(arg1) {
this.arg2 = arg2
this.arg3 = arg3
}
constructor(arg1: Int, arg2: Int) : this(arg1) {
this.arg2 = arg2
arg3 = 0
}
init {
arg2 = 0
arg3 = 0
}
}
@@ -0,0 +1,11 @@
public class AAA {
private int x = 42;
public int getX() {
return x;
}
public void setY(int x) {
this.x = x;
}
}
@@ -0,0 +1,8 @@
class AAA {
var x = 42
private set
fun setY(x: Int) {
this.x = x
}
}
@@ -0,0 +1,25 @@
public class AAA {
private int x = 42;
public int getX() {
return x;
}
public void setX(int x) {
this.x = x;
}
public void foo() {
setX(getX() + 1);
}
public void bar(AAA other) {
other.setX(other.getX() + 1);
}
}
class B {
void foo(AAA a) {
a.setX(a.getX() + 1);
}
}
@@ -0,0 +1,17 @@
class AAA {
var x = 42
fun foo() {
x = x + 1
}
fun bar(other: AAA) {
other.x = other.x + 1
}
}
internal class B {
fun foo(a: AAA) {
a.x = a.x + 1
}
}
@@ -0,0 +1,7 @@
class A {
private String s;
public Object getValue() {
return s;
}
}
@@ -0,0 +1,7 @@
// ERROR: Type mismatch: inferred type is kotlin.String? but kotlin.Any was expected
internal class A {
private val s: String? = null
val value: Any
get() = s
}
@@ -0,0 +1,15 @@
public class AAA {
public void foo() {
setX(getX() + 1);
}
private static int ourX = 42;
public static int getX() {
return ourX;
}
public static void setX(int x) {
ourX = x;
}
}
@@ -0,0 +1,10 @@
class AAA {
fun foo() {
x = x + 1
}
companion object {
var x = 42
}
}
@@ -0,0 +1,14 @@
interface I {
int getSomething1();
int getSomething2();
void setSomething2(int value);
void setSomething3(int value);
int getSomething4();
void setSomething4(String value);
int getSomething5();
int setSomething5(int value);
}
@@ -0,0 +1,13 @@
internal interface I {
val something1: Int
var something2: Int
fun setSomething3(value: Int)
val something4: Int
fun setSomething4(value: String)
val something5: Int
fun setSomething5(value: Int): Int
}
@@ -0,0 +1,33 @@
public class AAA {
private static int ourX = 42;
private static int y = 0;
private static int z = 0;
public static int getX() {
return ourX;
}
public static void setX(int x) {
ourX = x;
}
public static int getY() {
return y;
}
public static void setY(int y) {
AAA.y = y;
}
public static int getZ() {
return z;
}
public static void setZ(int z) {
Other.z = z;
}
}
class Other {
public static int z = 0;
}
+12
View File
@@ -0,0 +1,12 @@
object AAA {
var x = 42
var y = 0
var z = 0
set(z: Int) {
Other.z = z
}
}
internal object Other {
var z = 0
}
@@ -0,0 +1,11 @@
class C {
private int field = 0;
public int getDefault() {
return field;
}
void foo() {
System.out.println(field);
}
}
@@ -0,0 +1,7 @@
internal class C {
val default = 0
fun foo() {
println(default)
}
}
@@ -0,0 +1,11 @@
class C {
private int field = 0;
public int getThis() {
return field;
}
void foo() {
System.out.println(field);
}
}
@@ -0,0 +1,7 @@
internal class C {
val `this` = 0
fun foo() {
println(`this`)
}
}
@@ -0,0 +1,133 @@
interface I {
int getSomething1();
int getSomething2();
int getSomething3();
void setSomething3(int value);
int getSomething4();
void setSomething4(int value);
int getSomething5();
void setSomething5(int value);
void setSomething6(int value);
}
interface I1 extends I {
void setSomething1(int value);
int getSomething6();
}
class B {
public String getFromB1() {
return "";
}
public String getFromB2() {
return "";
}
public void setFromB2(String value) {
}
public String getFromB3() {
return "";
}
public void setFromB3(String value) {
}
public String getFromB4() {
return "";
}
public void setFromB4(String value) {
}
public void setFromB5(String value) {
}
}
abstract class C extends B implements I {
private final int mySomething1;
private int mySomething6;
C(int something1) {
mySomething1 = something1;
}
@Override
public int getSomething1() {
return mySomething1;
}
@Override
public int getSomething2() {
return 0;
}
@Override
public int getSomething3() {
return 0;
}
@Override
public void setSomething3(int value) {
}
@Override
public int getSomething4() {
return 0;
}
@Override
public void setSomething5(int value) {
}
public int getSomething6() {
return mySomething6;
}
@Override
public void setSomething6(int value) {
mySomething6 = value;
}
@Override
public String getFromB1() {
return super.getFromB1();
}
@Override
public String getFromB2() {
return super.getFromB2();
}
@Override
public void setFromB2(String value) {
super.setFromB2(value);
}
@Override
public String getFromB3() {
return super.getFromB3();
}
@Override
public void setFromB4(String value) {
super.setFromB4(value);
}
public String getFromB5() {
return "";
}
@Override
public void setFromB5(String value) {
super.setFromB5(value);
}
}
+104
View File
@@ -0,0 +1,104 @@
// ERROR: Abstract member cannot be accessed directly
// ERROR: Abstract member cannot be accessed directly
internal interface I {
val something1: Int
val something2: Int
var something3: Int
var something4: Int
var something5: Int
fun setSomething6(value: Int)
}
internal interface I1 : I {
fun setSomething1(value: Int)
val something6: Int
}
internal open class B {
open val fromB1: String
get() = ""
open var fromB2: String
get() = ""
set(value: String) {
}
open var fromB3: String
get() = ""
set(value: String) {
}
open var fromB4: String
get() = ""
set(value: String) {
}
open fun setFromB5(value: String) {
}
}
internal abstract class C(override val something1: Int) : B(), I {
private var mySomething6: Int = 0
override val something2: Int
get() = 0
override var something3: Int
get() = 0
set(value: Int) {
}
override var something4: Int
get() = 0
set(value: Int) {
super.something4 = value
}
override var something5: Int
get() = super.something5
set(value: Int) {
}
fun getSomething6(): Int {
return mySomething6
}
override fun setSomething6(value: Int) {
mySomething6 = value
}
override val fromB1: String
get() = super.fromB1
override var fromB2: String
get() = super.fromB2
set(value: String) {
super.fromB2 = value
}
override var fromB3: String
get() = super.fromB3
set(value: String) {
super.fromB3 = value
}
override var fromB4: String
get() = super.fromB4
set(value: String) {
super.fromB4 = value
}
val fromB5: String
get() = ""
override fun setFromB5(value: String) {
super.setFromB5(value)
}
}
@@ -0,0 +1,113 @@
import kotlinApi.KotlinClassWithProperties;
import javaApi.JavaClassWithProperties;
import javaApi.JavaClassDerivedFromKotlinClassWithProperties;
import org.jetbrains.annotations.NotNull;
import java.lang.Override;
import java.lang.String;
class A extends KotlinClassWithProperties {
@NotNull
@Override
public String getSomeVar1() {
return super.getSomeVar1();
}
@Override
public void setSomeVar1(@NotNull String s) {
super.setSomeVar1(s);
}
@NotNull
@Override
public String getSomeVar2() {
return super.getSomeVar2();
}
@Override
public void setSomeVar3(@NotNull String s) {
super.setSomeVar3(s);
}
@NotNull
@Override
public String getSomeVar4() {
return super.getSomeVar4();
}
@NotNull
@Override
public String getSomeVal() {
return super.getSomeVal();
}
@Override
public void getSomething1() {
super.getSomething1();
}
@Override
public void getSomething2() {
super.getSomething2();
}
@Override
public void setSomething2(int value) {
super.setSomething2(value);
}
@Override
public void getSomething3() {
super.getSomething3();
}
@Override
public void setSomething4(int value) {
super.setSomething4(value);
}
}
class B extends JavaClassWithProperties {
@Override
public int getValue1() {
return super.getValue1();
}
@Override
public int getValue2() {
return super.getValue2();
}
@Override
public void setValue2(int value) {
super.setValue2(value);
}
@Override
public int getValue3() {
return super.getValue3();
}
@Override
public void setValue4(int value) {
super.setValue4(value);
}
}
class C extends A {
@NotNull
@Override
public String getSomeVar1() {
return super.getSomeVar1();
}
}
class D extends JavaClassDerivedFromKotlinClassWithProperties {
@Override
public String getSomeVar1() { return "a"; }
@Override
public void setSomeVar2(String value) { }
}
@@ -0,0 +1,96 @@
import kotlinApi.KotlinClassWithProperties
import javaApi.JavaClassWithProperties
import javaApi.JavaClassDerivedFromKotlinClassWithProperties
internal open class A : KotlinClassWithProperties() {
override var someVar1: String
get() = super.someVar1
set(s: String) {
super.someVar1 = s
}
override var someVar2: String
get() = super.someVar2
set(value: String) {
super.someVar2 = value
}
override var someVar3: String
get() = super.someVar3
set(s: String) {
super.someVar3 = s
}
override var someVar4: String
get() = super.someVar4
set(value: String) {
super.someVar4 = value
}
override val someVal: String
get() = super.someVal
override fun getSomething1() {
super.getSomething1()
}
override fun getSomething2() {
super.getSomething2()
}
override fun setSomething2(value: Int) {
super.setSomething2(value)
}
override fun getSomething3() {
super.getSomething3()
}
override fun setSomething4(value: Int) {
super.setSomething4(value)
}
}
internal class B : JavaClassWithProperties() {
override fun getValue1(): Int {
return super.getValue1()
}
override fun getValue2(): Int {
return super.getValue2()
}
override fun setValue2(value: Int) {
super.setValue2(value)
}
override fun getValue3(): Int {
return super.getValue3()
}
override fun setValue4(value: Int) {
super.setValue4(value)
}
}
internal class C : A() {
override var someVar1: String
get() = super.someVar1
set(value: String) {
super.someVar1 = value
}
}
internal class D : JavaClassDerivedFromKotlinClassWithProperties() {
override var someVar1: String
get() = "a"
set(value: String) {
super.someVar1 = value
}
override var someVar2: String
get() = super.someVar2
set(value: String) {
}
}
@@ -0,0 +1,32 @@
public class AAA {
private int myX = 42;
public int getX() {
return myX;
}
public void foo(final int x) {
System.out.println(x);
System.out.println(getX());
System.out.println(myX);
Runnable runnable = new Runnable() {
@Override
public void run() {
System.out.println(x);
System.out.println(getX());
System.out.println(myX);
}
};
}
class Nested {
int x = myX;
void foo() {
System.out.println(x);
System.out.println(getX());
System.out.println(myX);
}
}
}
@@ -0,0 +1,11 @@
class A {
private Object o;
public Object getValue() {
return o;
}
public void setValue(String s) {
o = s;
}
}
@@ -0,0 +1,8 @@
internal class A {
var value: Any? = null
private set
fun setValue(s: String) {
value = s
}
}