mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
Initial implementation of platformStatic
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import java.lang.annotation.Retention
|
||||
import java.lang.annotation.RetentionPolicy
|
||||
|
||||
Retention(RetentionPolicy.RUNTIME)
|
||||
annotation class testAnnotation
|
||||
|
||||
class A {
|
||||
|
||||
class object {
|
||||
val b: String = "OK"
|
||||
|
||||
platformStatic testAnnotation fun test1() = b
|
||||
}
|
||||
}
|
||||
|
||||
object B {
|
||||
val b: String = "OK"
|
||||
|
||||
platformStatic testAnnotation fun test1() = b
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
if (Test.test1() != "OK") return "fail 1"
|
||||
|
||||
if (Test.test2() != "OK") return "fail 2"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user