mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
28 lines
493 B
Kotlin
Vendored
28 lines
493 B
Kotlin
Vendored
import kotlin.jvm.JvmStatic
|
|
|
|
class A {
|
|
|
|
companion object {
|
|
val b: String = "OK"
|
|
|
|
@JvmStatic val c: String = "OK"
|
|
|
|
@JvmStatic fun test1() = b
|
|
|
|
@JvmStatic fun test2() = b
|
|
|
|
@JvmStatic fun String.test3() = this + b
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
if (Test.test1() != "OK") return "fail 1"
|
|
|
|
if (Test.test2() != "OK") return "fail 2"
|
|
|
|
if (Test.test3() != "JAVAOK") return "fail 3"
|
|
|
|
if (Test.test4() != "OK") return "fail 4"
|
|
|
|
return "OK"
|
|
} |