J2K does not convert usages of java "get" methods into "[]" (explicit "operator" modifier is required)
This commit is contained in:
Vendored
+6
@@ -113,4 +113,10 @@ public class JavaClassDerivedFromKotlinClassWithProperties extends KotlinClassWi
|
||||
|
||||
@Override
|
||||
public void setSomeVar2(String value) { }
|
||||
}
|
||||
|
||||
public class JavaClass {
|
||||
public int get(int p) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import java.util.HashMap;
|
||||
import kotlinApi.KotlinClass;
|
||||
import javaApi.JavaClass;
|
||||
|
||||
class X {
|
||||
int get(int index) {
|
||||
@@ -19,4 +20,8 @@ class C {
|
||||
int foo(KotlinClass kotlinClass) {
|
||||
return kotlinClass.get(0); // not operator!
|
||||
}
|
||||
|
||||
int foo(JavaClass javaClass) {
|
||||
return javaClass.get(0);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
// ERROR: Type mismatch: inferred type is kotlin.String? but kotlin.String was expected
|
||||
import java.util.HashMap
|
||||
import kotlinApi.KotlinClass
|
||||
import javaApi.JavaClass
|
||||
|
||||
internal class X {
|
||||
operator fun get(index: Int): Int {
|
||||
@@ -20,4 +21,8 @@ internal class C {
|
||||
fun foo(kotlinClass: KotlinClass): Int {
|
||||
return kotlinClass.get(0) // not operator!
|
||||
}
|
||||
}
|
||||
|
||||
fun foo(javaClass: JavaClass): Int {
|
||||
return javaClass.get(0)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user