KT-5524 Support [platformName] annotation for class members
@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
This commit is contained in:
+18
-1
@@ -4,4 +4,21 @@ import kotlin.platform.*
|
||||
@platformName("bar")
|
||||
fun foo(a: Any) {}
|
||||
|
||||
fun Any.foo() {}
|
||||
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) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user