Files
kotlin-fork/idea/testData/checker/PlatformStaticUsagesRuntime.kt
T
2015-05-13 16:13:13 +02:00

57 lines
2.0 KiB
Kotlin
Vendored

import kotlin.platform.platformStatic
platformStatic
class <error descr="[PLATFORM_STATIC_ILLEGAL_USAGE] This declaration does not support 'platformStatic'">A</error> {
platformStatic
companion <error descr="[PLATFORM_STATIC_ILLEGAL_USAGE] This declaration does not support 'platformStatic'">object</error> {
platformStatic fun a1() {
}
}
platformStatic
<error descr="[PLATFORM_STATIC_ILLEGAL_USAGE] This declaration does not support 'platformStatic'">object A</error> {
platformStatic fun a2() {
}
}
fun test() {
val <warning descr="[UNUSED_VARIABLE] Variable 's' is never used">s</warning> = object {
<error descr="[PLATFORM_STATIC_NOT_IN_OBJECT] Only functions in named objects and companion objects of classes can be annotated with 'platformStatic'">platformStatic fun a3()</error> {
}
}
}
<error descr="[PLATFORM_STATIC_NOT_IN_OBJECT] Only functions in named objects and companion objects of classes can be annotated with 'platformStatic'">platformStatic fun a4()</error> {
}
}
platformStatic
interface <error descr="[PLATFORM_STATIC_ILLEGAL_USAGE] This declaration does not support 'platformStatic'">B</error> {
companion object {
<error descr="[PLATFORM_STATIC_NOT_IN_OBJECT] Only functions in named objects and companion objects of classes can be annotated with 'platformStatic'">platformStatic fun a1()</error> {
}
}
object A {
platformStatic fun a2() {
}
}
fun test() {
val <warning descr="[UNUSED_VARIABLE] Variable 's' is never used">s</warning> = object {
<error descr="[PLATFORM_STATIC_NOT_IN_OBJECT] Only functions in named objects and companion objects of classes can be annotated with 'platformStatic'">platformStatic fun a3()</error> {
}
}
}
<error descr="[PLATFORM_STATIC_NOT_IN_OBJECT] Only functions in named objects and companion objects of classes can be annotated with 'platformStatic'">platformStatic fun a4()</error> {
}
}