Fix for KT-16801: Accessors of @PublishedApi property gets mangled

#KT-16801 Fixed
This commit is contained in:
Mikhael Bogdanov
2017-03-13 10:49:09 +01:00
parent c46164481a
commit ce3b455f57
5 changed files with 19 additions and 10 deletions
+8 -4
View File
@@ -2,14 +2,18 @@
//WITH_REFLECT
class A {
@PublishedApi
internal fun published() = "OK"
internal fun published() = "O"
inline fun test() = published()
@PublishedApi
internal var publishedProp = "K"
inline fun test() = published() + publishedProp
}
fun box() : String {
val clazz = A::class.java
if (clazz.getDeclaredMethod("published") == null) return "fail"
return "OK"
if (clazz.getDeclaredMethod("published") == null) return "fail 1"
if (clazz.getDeclaredMethod("getPublishedProp") == null) return "fail 2"
if (clazz.getDeclaredMethod("setPublishedProp", String::class.java) == null) return "fail 3"
return A().test()
}
@@ -1,7 +1,11 @@
@kotlin.Metadata
public final class A {
private @org.jetbrains.annotations.NotNull field publishedProp: java.lang.String
public method <init>(): void
public final @org.jetbrains.annotations.NotNull method getPublishedProp(): java.lang.String
public final @kotlin.PublishedApi @org.jetbrains.annotations.NotNull method published(): java.lang.String
public synthetic deprecated static @kotlin.PublishedApi method publishedProp$annotations(): void
public final method setPublishedProp(@org.jetbrains.annotations.NotNull p0: java.lang.String): void
public final @org.jetbrains.annotations.NotNull method test(): java.lang.String
}