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:
@@ -0,0 +1,12 @@
|
||||
import kotlin.platform.platformName;
|
||||
|
||||
public class FakePlatformName {
|
||||
@platformName(name = "fake")
|
||||
public String foo() {
|
||||
return "foo";
|
||||
}
|
||||
|
||||
public String fake() {
|
||||
return "fake";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
fun box(): String {
|
||||
val test1 = FakePlatformName().foo()
|
||||
if (test1 != "foo") return "Failed: FakePlatformName().foo()==$test1"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user