Renamed test data folder

This commit is contained in:
Valentin Kipyatkov
2015-10-16 22:47:30 +03:00
parent dc909ac166
commit 4e73fe0f39
18 changed files with 114 additions and 114 deletions
@@ -0,0 +1,22 @@
import java.util.HashMap;
import kotlinApi.KotlinClass;
class X {
int get(int index) {
return 0;
}
}
class C {
String foo(HashMap<String, String> map) {
return map.get("a");
}
int foo(X x) {
return x.get(0);
}
int foo(KotlinClass kotlinClass) {
return kotlinClass.get(0); // not operator!
}
}
@@ -0,0 +1,23 @@
// ERROR: Type mismatch: inferred type is kotlin.String? but kotlin.String was expected
import java.util.HashMap
import kotlinApi.KotlinClass
internal class X {
fun get(index: Int): Int {
return 0
}
}
internal class C {
fun foo(map: HashMap<String, String>): String {
return map["a"]
}
fun foo(x: X): Int {
return x.get(0)
}
fun foo(kotlinClass: KotlinClass): Int {
return kotlinClass.get(0) // not operator!
}
}
@@ -0,0 +1,9 @@
import java.io.File;
class C {
String foo(File file) {
File parent = file.getParentFile();
if (parent == null) return "";
return parent.getName();
}
}
@@ -0,0 +1,8 @@
import java.io.File
internal class C {
fun foo(file: File): String {
val parent = file.parentFile ?: return ""
return parent.name
}
}
@@ -0,0 +1,5 @@
class C {
String foo(String s) {
return s != null ? s : "";
}
}
@@ -0,0 +1,5 @@
internal class C {
fun foo(s: String?): String {
return s ?: ""
}
}
@@ -0,0 +1,9 @@
import java.io.File;
class C {
void foo(File file) {
if (file != null) {
file.delete();
}
}
}
@@ -0,0 +1,7 @@
import java.io.File
internal class C {
fun foo(file: File?) {
file?.delete()
}
}
+6
View File
@@ -0,0 +1,6 @@
class C {
void foo(Object o) {
if (!(o instanceof String)) return;
System.out.println("String");
}
}
+6
View File
@@ -0,0 +1,6 @@
internal class C {
fun foo(o: Any) {
if (o !is String) return
println("String")
}
}
@@ -0,0 +1,7 @@
class C {
void foo(Object o) {
if (o instanceof String) {
int l = ((String) o).length();
}
}
}
@@ -0,0 +1,7 @@
internal class C {
fun foo(o: Any) {
if (o is String) {
val l = o.length
}
}
}
@@ -0,0 +1,11 @@
import java.lang.String;
class C {
void foo(Object o) {
if (o instanceof String) {
String s = (String) o;
int l = s.length();
String substring = s.substring(l - 2);
}
}
}
@@ -0,0 +1,8 @@
internal class C {
fun foo(o: Any) {
if (o is String) {
val l = o.length
val substring = o.substring(l - 2)
}
}
}
@@ -0,0 +1,15 @@
import javaApi.Base;
class C extends Base {
public void f() {
Base other = Base();
int value = other.getProperty() + getProperty();
other.setProperty(1);
setProperty(other.getProperty() + value);
getBase(getProperty()).setProperty(0);
}
private Base getBase(int i) {
return new Base();
}
}
@@ -0,0 +1,15 @@
import javaApi.Base
internal class C : Base() {
fun f() {
val other = Base()
val value = other.property + property
other.property = 1
property = other.property + value
getBase(property).property = 0
}
private fun getBase(i: Int): Base {
return Base()
}
}