Pull Up: Java -> Kotlin interoperability

#KT-5803 Fixed
This commit is contained in:
Alexey Sedunov
2015-08-06 16:20:12 +03:00
parent 556285f2c7
commit 7125989c69
50 changed files with 1337 additions and 337 deletions
@@ -0,0 +1,46 @@
import kotlin.platform.platformStatic
class T {
class U {
abstract class A {
// INFO: {"checked": "true"}
var x = 2 * 3
// INFO: {"checked": "true"}
inner class X
// INFO: {"checked": "true"}
class Y
// INFO: {"checked": "true"}
fun foo(n: Int): Boolean {
return n > 0
}
// INFO: {"checked": "true"}
abstract fun bar(s: String): Int
companion object {
// INFO: {"checked": "true"}
var X = "1" + "2"
// INFO: {"checked": "true"}
platformStatic fun foo2(n: Int): String {
return "_" + n + "_"
}
}
}
}
}
fun test() {
val b = object : B() {
override fun bar(s: String) = s.length()
}
val t1 = b.x
b.x = t1 + 1
val t2 = T.U.A.X
b.foo(1)
T.U.A.foo2(2)
T.U.A.Y()
}