50ea67ba13
@platformName is now supported for final non-overriding class member functions (including property accessors). Front-end provides diagnostics for inapplicable annotation cases. Code generation updated: - ignore kotlin.platform.platformName annotation for Java class methods; - bridges generation generates proper JVM declarations in case of methods renamed with @platformName. @platformName-related tests added. #KT-5524 Fixed
25 lines
424 B
Kotlin
Vendored
25 lines
424 B
Kotlin
Vendored
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
|
import kotlin.platform.*
|
|
|
|
@platformName("bar")
|
|
fun foo(a: Any) {}
|
|
|
|
fun Any.foo() {}
|
|
|
|
@platformName("barInt")
|
|
fun bar(x: List<Int>) {}
|
|
|
|
@platformName("barStr")
|
|
fun bar(x: List<String>) {}
|
|
|
|
class C {
|
|
var rwProp: Int
|
|
@platformName("get_rwProp")
|
|
get() = 0
|
|
@platformName("set_rwProp")
|
|
set(v) {}
|
|
|
|
fun getRwProp(): Int = 123
|
|
fun setRwProp(v: Int) {}
|
|
}
|