diff --git a/compiler/testData/klib/dump-abi/content/with_non_public_markers_1.kt b/compiler/testData/klib/dump-abi/content/with_non_public_markers_1.kt index 6abef3e945c..09daa27a947 100644 --- a/compiler/testData/klib/dump-abi/content/with_non_public_markers_1.kt +++ b/compiler/testData/klib/dump-abi/content/with_non_public_markers_1.kt @@ -115,3 +115,8 @@ var propertySetterMarkedWithBar: String get() = "" @Bar set(_) = Unit var propertySetterMarkedWithAnotherBar: String get() = "" @Another.Bar set(_) = Unit + +@field:Foo var propertyFieldMarkedWithFoo: String = "" +@field:Another.Foo var propertyFieldMarkedWithAnotherFoo: String = "" +@field:Bar var propertyFieldMarkedWithBar: String = "" +@field:Another.Bar var propertyFieldMarkedWithAnotherBar: String = "" diff --git a/compiler/testData/klib/dump-abi/content/with_non_public_markers_1.v1.txt b/compiler/testData/klib/dump-abi/content/with_non_public_markers_1.v1.txt index e466227e60f..f28eb8cfe95 100644 --- a/compiler/testData/klib/dump-abi/content/with_non_public_markers_1.v1.txt +++ b/compiler/testData/klib/dump-abi/content/with_non_public_markers_1.v1.txt @@ -198,6 +198,18 @@ final class /NonMarkedClass { // /NonMarkedClass|null[0] final var /nonMarkedProperty // /nonMarkedProperty|2555039021383536112[0] final fun (): kotlin/String // /nonMarkedProperty.|3521952790317234139[0] final fun (kotlin/String) // /nonMarkedProperty.|-1967656686156177486[0] +final var /propertyFieldMarkedWithAnotherBar // /propertyFieldMarkedWithAnotherBar|8652907074743105395[0] + final fun (): kotlin/String // /propertyFieldMarkedWithAnotherBar.|4027680594200313982[0] + final fun (kotlin/String) // /propertyFieldMarkedWithAnotherBar.|-752930589596308927[0] +final var /propertyFieldMarkedWithAnotherFoo // /propertyFieldMarkedWithAnotherFoo|-5550265860273959081[0] + final fun (): kotlin/String // /propertyFieldMarkedWithAnotherFoo.|-6889753180756300437[0] + final fun (kotlin/String) // /propertyFieldMarkedWithAnotherFoo.|-7885823532742642204[0] +final var /propertyFieldMarkedWithBar // /propertyFieldMarkedWithBar|-5109570069593982425[0] + final fun (): kotlin/String // /propertyFieldMarkedWithBar.|-4683505128382207138[0] + final fun (kotlin/String) // /propertyFieldMarkedWithBar.|2337043424600902160[0] +final var /propertyFieldMarkedWithFoo // /propertyFieldMarkedWithFoo|-287426710232690254[0] + final fun (): kotlin/String // /propertyFieldMarkedWithFoo.|1685770549830377973[0] + final fun (kotlin/String) // /propertyFieldMarkedWithFoo.|-2442005456517407360[0] final var /propertyGetterMarkedWithAnotherBar // /propertyGetterMarkedWithAnotherBar|-8321084504405299502[0] final fun (): kotlin/String // /propertyGetterMarkedWithAnotherBar.|7768138341638919361[0] final fun (kotlin/String) // /propertyGetterMarkedWithAnotherBar.|1952287206559835979[0] diff --git a/compiler/testData/klib/dump-abi/content/with_non_public_markers_1.v2.txt b/compiler/testData/klib/dump-abi/content/with_non_public_markers_1.v2.txt index c44f4ea3fee..382da0fd5db 100644 --- a/compiler/testData/klib/dump-abi/content/with_non_public_markers_1.v2.txt +++ b/compiler/testData/klib/dump-abi/content/with_non_public_markers_1.v2.txt @@ -198,6 +198,18 @@ final class /NonMarkedClass { // /NonMarkedClass|null[0] final var /nonMarkedProperty // /nonMarkedProperty|{}nonMarkedProperty[0] final fun (): kotlin/String // /nonMarkedProperty.|(){}[0] final fun (kotlin/String) // /nonMarkedProperty.|(kotlin.String){}[0] +final var /propertyFieldMarkedWithAnotherBar // /propertyFieldMarkedWithAnotherBar|{}propertyFieldMarkedWithAnotherBar[0] + final fun (): kotlin/String // /propertyFieldMarkedWithAnotherBar.|(){}[0] + final fun (kotlin/String) // /propertyFieldMarkedWithAnotherBar.|(kotlin.String){}[0] +final var /propertyFieldMarkedWithAnotherFoo // /propertyFieldMarkedWithAnotherFoo|{}propertyFieldMarkedWithAnotherFoo[0] + final fun (): kotlin/String // /propertyFieldMarkedWithAnotherFoo.|(){}[0] + final fun (kotlin/String) // /propertyFieldMarkedWithAnotherFoo.|(kotlin.String){}[0] +final var /propertyFieldMarkedWithBar // /propertyFieldMarkedWithBar|{}propertyFieldMarkedWithBar[0] + final fun (): kotlin/String // /propertyFieldMarkedWithBar.|(){}[0] + final fun (kotlin/String) // /propertyFieldMarkedWithBar.|(kotlin.String){}[0] +final var /propertyFieldMarkedWithFoo // /propertyFieldMarkedWithFoo|{}propertyFieldMarkedWithFoo[0] + final fun (): kotlin/String // /propertyFieldMarkedWithFoo.|(){}[0] + final fun (kotlin/String) // /propertyFieldMarkedWithFoo.|(kotlin.String){}[0] final var /propertyGetterMarkedWithAnotherBar // /propertyGetterMarkedWithAnotherBar|{}propertyGetterMarkedWithAnotherBar[0] final fun (): kotlin/String // /propertyGetterMarkedWithAnotherBar.|(){}[0] final fun (kotlin/String) // /propertyGetterMarkedWithAnotherBar.|(kotlin.String){}[0] diff --git a/compiler/testData/klib/dump-abi/content/with_non_public_markers_2.kt b/compiler/testData/klib/dump-abi/content/with_non_public_markers_2.kt index 8f00177ceca..0decc00f097 100644 --- a/compiler/testData/klib/dump-abi/content/with_non_public_markers_2.kt +++ b/compiler/testData/klib/dump-abi/content/with_non_public_markers_2.kt @@ -115,3 +115,8 @@ var propertySetterMarkedWithBar: String get() = "" @Bar set(_) = Unit var propertySetterMarkedWithAnotherBar: String get() = "" @Another.Bar set(_) = Unit + +@field:Foo var propertyFieldMarkedWithFoo: String = "" +@field:Another.Foo var propertyFieldMarkedWithAnotherFoo: String = "" +@field:Bar var propertyFieldMarkedWithBar: String = "" +@field:Another.Bar var propertyFieldMarkedWithAnotherBar: String = "" diff --git a/compiler/testData/klib/dump-abi/content/with_non_public_markers_2.v1.txt b/compiler/testData/klib/dump-abi/content/with_non_public_markers_2.v1.txt index e664131690e..9ee72dabdf4 100644 --- a/compiler/testData/klib/dump-abi/content/with_non_public_markers_2.v1.txt +++ b/compiler/testData/klib/dump-abi/content/with_non_public_markers_2.v1.txt @@ -139,6 +139,15 @@ final class /NonMarkedClass { // /NonMarkedClass|null[0] final var /nonMarkedProperty // /nonMarkedProperty|2555039021383536112[0] final fun (): kotlin/String // /nonMarkedProperty.|3521952790317234139[0] final fun (kotlin/String) // /nonMarkedProperty.|-1967656686156177486[0] +final var /propertyFieldMarkedWithAnotherBar // /propertyFieldMarkedWithAnotherBar|8652907074743105395[0] + final fun (): kotlin/String // /propertyFieldMarkedWithAnotherBar.|4027680594200313982[0] + final fun (kotlin/String) // /propertyFieldMarkedWithAnotherBar.|-752930589596308927[0] +final var /propertyFieldMarkedWithAnotherFoo // /propertyFieldMarkedWithAnotherFoo|-5550265860273959081[0] + final fun (): kotlin/String // /propertyFieldMarkedWithAnotherFoo.|-6889753180756300437[0] + final fun (kotlin/String) // /propertyFieldMarkedWithAnotherFoo.|-7885823532742642204[0] +final var /propertyFieldMarkedWithBar // /propertyFieldMarkedWithBar|-5109570069593982425[0] + final fun (): kotlin/String // /propertyFieldMarkedWithBar.|-4683505128382207138[0] + final fun (kotlin/String) // /propertyFieldMarkedWithBar.|2337043424600902160[0] final var /propertyGetterMarkedWithAnotherBar // /propertyGetterMarkedWithAnotherBar|-8321084504405299502[0] final fun (): kotlin/String // /propertyGetterMarkedWithAnotherBar.|7768138341638919361[0] final fun (kotlin/String) // /propertyGetterMarkedWithAnotherBar.|1952287206559835979[0] diff --git a/compiler/testData/klib/dump-abi/content/with_non_public_markers_2.v2.txt b/compiler/testData/klib/dump-abi/content/with_non_public_markers_2.v2.txt index 176687b96e3..e400f1ebcf9 100644 --- a/compiler/testData/klib/dump-abi/content/with_non_public_markers_2.v2.txt +++ b/compiler/testData/klib/dump-abi/content/with_non_public_markers_2.v2.txt @@ -139,6 +139,15 @@ final class /NonMarkedClass { // /NonMarkedClass|null[0] final var /nonMarkedProperty // /nonMarkedProperty|{}nonMarkedProperty[0] final fun (): kotlin/String // /nonMarkedProperty.|(){}[0] final fun (kotlin/String) // /nonMarkedProperty.|(kotlin.String){}[0] +final var /propertyFieldMarkedWithAnotherBar // /propertyFieldMarkedWithAnotherBar|{}propertyFieldMarkedWithAnotherBar[0] + final fun (): kotlin/String // /propertyFieldMarkedWithAnotherBar.|(){}[0] + final fun (kotlin/String) // /propertyFieldMarkedWithAnotherBar.|(kotlin.String){}[0] +final var /propertyFieldMarkedWithAnotherFoo // /propertyFieldMarkedWithAnotherFoo|{}propertyFieldMarkedWithAnotherFoo[0] + final fun (): kotlin/String // /propertyFieldMarkedWithAnotherFoo.|(){}[0] + final fun (kotlin/String) // /propertyFieldMarkedWithAnotherFoo.|(kotlin.String){}[0] +final var /propertyFieldMarkedWithBar // /propertyFieldMarkedWithBar|{}propertyFieldMarkedWithBar[0] + final fun (): kotlin/String // /propertyFieldMarkedWithBar.|(){}[0] + final fun (kotlin/String) // /propertyFieldMarkedWithBar.|(kotlin.String){}[0] final var /propertyGetterMarkedWithAnotherBar // /propertyGetterMarkedWithAnotherBar|{}propertyGetterMarkedWithAnotherBar[0] final fun (): kotlin/String // /propertyGetterMarkedWithAnotherBar.|(){}[0] final fun (kotlin/String) // /propertyGetterMarkedWithAnotherBar.|(kotlin.String){}[0] diff --git a/compiler/testData/klib/dump-abi/content/with_non_public_markers_3.kt b/compiler/testData/klib/dump-abi/content/with_non_public_markers_3.kt index 240396424d8..85af589d1af 100644 --- a/compiler/testData/klib/dump-abi/content/with_non_public_markers_3.kt +++ b/compiler/testData/klib/dump-abi/content/with_non_public_markers_3.kt @@ -115,3 +115,8 @@ var propertySetterMarkedWithBar: String get() = "" @Bar set(_) = Unit var propertySetterMarkedWithAnotherBar: String get() = "" @Another.Bar set(_) = Unit + +@field:Foo var propertyFieldMarkedWithFoo: String = "" +@field:Another.Foo var propertyFieldMarkedWithAnotherFoo: String = "" +@field:Bar var propertyFieldMarkedWithBar: String = "" +@field:Another.Bar var propertyFieldMarkedWithAnotherBar: String = "" diff --git a/compiler/testData/klib/dump-abi/content/with_non_public_markers_3.v1.txt b/compiler/testData/klib/dump-abi/content/with_non_public_markers_3.v1.txt index dd2799cb377..3a8f5687034 100644 --- a/compiler/testData/klib/dump-abi/content/with_non_public_markers_3.v1.txt +++ b/compiler/testData/klib/dump-abi/content/with_non_public_markers_3.v1.txt @@ -92,6 +92,12 @@ final class /NonMarkedClass { // /NonMarkedClass|null[0] final var /nonMarkedProperty // /nonMarkedProperty|2555039021383536112[0] final fun (): kotlin/String // /nonMarkedProperty.|3521952790317234139[0] final fun (kotlin/String) // /nonMarkedProperty.|-1967656686156177486[0] +final var /propertyFieldMarkedWithAnotherFoo // /propertyFieldMarkedWithAnotherFoo|-5550265860273959081[0] + final fun (): kotlin/String // /propertyFieldMarkedWithAnotherFoo.|-6889753180756300437[0] + final fun (kotlin/String) // /propertyFieldMarkedWithAnotherFoo.|-7885823532742642204[0] +final var /propertyFieldMarkedWithBar // /propertyFieldMarkedWithBar|-5109570069593982425[0] + final fun (): kotlin/String // /propertyFieldMarkedWithBar.|-4683505128382207138[0] + final fun (kotlin/String) // /propertyFieldMarkedWithBar.|2337043424600902160[0] final var /propertyGetterMarkedWithAnotherBar // /propertyGetterMarkedWithAnotherBar|-8321084504405299502[0] final fun (kotlin/String) // /propertyGetterMarkedWithAnotherBar.|1952287206559835979[0] final var /propertyGetterMarkedWithAnotherFoo // /propertyGetterMarkedWithAnotherFoo|839569568647204104[0] diff --git a/compiler/testData/klib/dump-abi/content/with_non_public_markers_3.v2.txt b/compiler/testData/klib/dump-abi/content/with_non_public_markers_3.v2.txt index f878ca535f0..2e6ab5eff3a 100644 --- a/compiler/testData/klib/dump-abi/content/with_non_public_markers_3.v2.txt +++ b/compiler/testData/klib/dump-abi/content/with_non_public_markers_3.v2.txt @@ -92,6 +92,12 @@ final class /NonMarkedClass { // /NonMarkedClass|null[0] final var /nonMarkedProperty // /nonMarkedProperty|{}nonMarkedProperty[0] final fun (): kotlin/String // /nonMarkedProperty.|(){}[0] final fun (kotlin/String) // /nonMarkedProperty.|(kotlin.String){}[0] +final var /propertyFieldMarkedWithAnotherFoo // /propertyFieldMarkedWithAnotherFoo|{}propertyFieldMarkedWithAnotherFoo[0] + final fun (): kotlin/String // /propertyFieldMarkedWithAnotherFoo.|(){}[0] + final fun (kotlin/String) // /propertyFieldMarkedWithAnotherFoo.|(kotlin.String){}[0] +final var /propertyFieldMarkedWithBar // /propertyFieldMarkedWithBar|{}propertyFieldMarkedWithBar[0] + final fun (): kotlin/String // /propertyFieldMarkedWithBar.|(){}[0] + final fun (kotlin/String) // /propertyFieldMarkedWithBar.|(kotlin.String){}[0] final var /propertyGetterMarkedWithAnotherBar // /propertyGetterMarkedWithAnotherBar|{}propertyGetterMarkedWithAnotherBar[0] final fun (kotlin/String) // /propertyGetterMarkedWithAnotherBar.|(kotlin.String){}[0] final var /propertyGetterMarkedWithAnotherFoo // /propertyGetterMarkedWithAnotherFoo|{}propertyGetterMarkedWithAnotherFoo[0] diff --git a/compiler/testData/klib/dump-abi/content/with_non_public_markers_4.kt b/compiler/testData/klib/dump-abi/content/with_non_public_markers_4.kt index 761308e24ac..a917e89572d 100644 --- a/compiler/testData/klib/dump-abi/content/with_non_public_markers_4.kt +++ b/compiler/testData/klib/dump-abi/content/with_non_public_markers_4.kt @@ -117,3 +117,8 @@ var propertySetterMarkedWithBar: String get() = "" @Bar set(_) = Unit var propertySetterMarkedWithAnotherBar: String get() = "" @Another.Bar set(_) = Unit + +@field:Foo var propertyFieldMarkedWithFoo: String = "" +@field:Another.Foo var propertyFieldMarkedWithAnotherFoo: String = "" +@field:Bar var propertyFieldMarkedWithBar: String = "" +@field:Another.Bar var propertyFieldMarkedWithAnotherBar: String = "" diff --git a/compiler/testData/klib/dump-abi/content/with_non_public_markers_4.v1.txt b/compiler/testData/klib/dump-abi/content/with_non_public_markers_4.v1.txt index 9303c09bec7..647e9c548e2 100644 --- a/compiler/testData/klib/dump-abi/content/with_non_public_markers_4.v1.txt +++ b/compiler/testData/klib/dump-abi/content/with_non_public_markers_4.v1.txt @@ -139,6 +139,15 @@ final class non_public_markers.test/NonMarkedClass { // non_public_markers.test/ final var non_public_markers.test/nonMarkedProperty // non_public_markers.test/nonMarkedProperty|2555039021383536112[0] final fun (): kotlin/String // non_public_markers.test/nonMarkedProperty.|3521952790317234139[0] final fun (kotlin/String) // non_public_markers.test/nonMarkedProperty.|-1967656686156177486[0] +final var non_public_markers.test/propertyFieldMarkedWithAnotherBar // non_public_markers.test/propertyFieldMarkedWithAnotherBar|8652907074743105395[0] + final fun (): kotlin/String // non_public_markers.test/propertyFieldMarkedWithAnotherBar.|4027680594200313982[0] + final fun (kotlin/String) // non_public_markers.test/propertyFieldMarkedWithAnotherBar.|-752930589596308927[0] +final var non_public_markers.test/propertyFieldMarkedWithAnotherFoo // non_public_markers.test/propertyFieldMarkedWithAnotherFoo|-5550265860273959081[0] + final fun (): kotlin/String // non_public_markers.test/propertyFieldMarkedWithAnotherFoo.|-6889753180756300437[0] + final fun (kotlin/String) // non_public_markers.test/propertyFieldMarkedWithAnotherFoo.|-7885823532742642204[0] +final var non_public_markers.test/propertyFieldMarkedWithBar // non_public_markers.test/propertyFieldMarkedWithBar|-5109570069593982425[0] + final fun (): kotlin/String // non_public_markers.test/propertyFieldMarkedWithBar.|-4683505128382207138[0] + final fun (kotlin/String) // non_public_markers.test/propertyFieldMarkedWithBar.|2337043424600902160[0] final var non_public_markers.test/propertyGetterMarkedWithAnotherBar // non_public_markers.test/propertyGetterMarkedWithAnotherBar|-8321084504405299502[0] final fun (): kotlin/String // non_public_markers.test/propertyGetterMarkedWithAnotherBar.|7768138341638919361[0] final fun (kotlin/String) // non_public_markers.test/propertyGetterMarkedWithAnotherBar.|1952287206559835979[0] diff --git a/compiler/testData/klib/dump-abi/content/with_non_public_markers_4.v2.txt b/compiler/testData/klib/dump-abi/content/with_non_public_markers_4.v2.txt index 0ad2890c0a4..8a69429e02e 100644 --- a/compiler/testData/klib/dump-abi/content/with_non_public_markers_4.v2.txt +++ b/compiler/testData/klib/dump-abi/content/with_non_public_markers_4.v2.txt @@ -139,6 +139,15 @@ final class non_public_markers.test/NonMarkedClass { // non_public_markers.test/ final var non_public_markers.test/nonMarkedProperty // non_public_markers.test/nonMarkedProperty|{}nonMarkedProperty[0] final fun (): kotlin/String // non_public_markers.test/nonMarkedProperty.|(){}[0] final fun (kotlin/String) // non_public_markers.test/nonMarkedProperty.|(kotlin.String){}[0] +final var non_public_markers.test/propertyFieldMarkedWithAnotherBar // non_public_markers.test/propertyFieldMarkedWithAnotherBar|{}propertyFieldMarkedWithAnotherBar[0] + final fun (): kotlin/String // non_public_markers.test/propertyFieldMarkedWithAnotherBar.|(){}[0] + final fun (kotlin/String) // non_public_markers.test/propertyFieldMarkedWithAnotherBar.|(kotlin.String){}[0] +final var non_public_markers.test/propertyFieldMarkedWithAnotherFoo // non_public_markers.test/propertyFieldMarkedWithAnotherFoo|{}propertyFieldMarkedWithAnotherFoo[0] + final fun (): kotlin/String // non_public_markers.test/propertyFieldMarkedWithAnotherFoo.|(){}[0] + final fun (kotlin/String) // non_public_markers.test/propertyFieldMarkedWithAnotherFoo.|(kotlin.String){}[0] +final var non_public_markers.test/propertyFieldMarkedWithBar // non_public_markers.test/propertyFieldMarkedWithBar|{}propertyFieldMarkedWithBar[0] + final fun (): kotlin/String // non_public_markers.test/propertyFieldMarkedWithBar.|(){}[0] + final fun (kotlin/String) // non_public_markers.test/propertyFieldMarkedWithBar.|(kotlin.String){}[0] final var non_public_markers.test/propertyGetterMarkedWithAnotherBar // non_public_markers.test/propertyGetterMarkedWithAnotherBar|{}propertyGetterMarkedWithAnotherBar[0] final fun (): kotlin/String // non_public_markers.test/propertyGetterMarkedWithAnotherBar.|(){}[0] final fun (kotlin/String) // non_public_markers.test/propertyGetterMarkedWithAnotherBar.|(kotlin.String){}[0] diff --git a/compiler/testData/klib/dump-abi/content/with_non_public_markers_5.kt b/compiler/testData/klib/dump-abi/content/with_non_public_markers_5.kt index 4b63820b39a..97dc28942b6 100644 --- a/compiler/testData/klib/dump-abi/content/with_non_public_markers_5.kt +++ b/compiler/testData/klib/dump-abi/content/with_non_public_markers_5.kt @@ -117,3 +117,8 @@ var propertySetterMarkedWithBar: String get() = "" @Bar set(_) = Unit var propertySetterMarkedWithAnotherBar: String get() = "" @Another.Bar set(_) = Unit + +@field:Foo var propertyFieldMarkedWithFoo: String = "" +@field:Another.Foo var propertyFieldMarkedWithAnotherFoo: String = "" +@field:Bar var propertyFieldMarkedWithBar: String = "" +@field:Another.Bar var propertyFieldMarkedWithAnotherBar: String = "" diff --git a/compiler/testData/klib/dump-abi/content/with_non_public_markers_5.v1.txt b/compiler/testData/klib/dump-abi/content/with_non_public_markers_5.v1.txt index 5f2576b9673..10dd28e67bf 100644 --- a/compiler/testData/klib/dump-abi/content/with_non_public_markers_5.v1.txt +++ b/compiler/testData/klib/dump-abi/content/with_non_public_markers_5.v1.txt @@ -92,6 +92,12 @@ final class non_public_markers.test/NonMarkedClass { // non_public_markers.test/ final var non_public_markers.test/nonMarkedProperty // non_public_markers.test/nonMarkedProperty|2555039021383536112[0] final fun (): kotlin/String // non_public_markers.test/nonMarkedProperty.|3521952790317234139[0] final fun (kotlin/String) // non_public_markers.test/nonMarkedProperty.|-1967656686156177486[0] +final var non_public_markers.test/propertyFieldMarkedWithAnotherFoo // non_public_markers.test/propertyFieldMarkedWithAnotherFoo|-5550265860273959081[0] + final fun (): kotlin/String // non_public_markers.test/propertyFieldMarkedWithAnotherFoo.|-6889753180756300437[0] + final fun (kotlin/String) // non_public_markers.test/propertyFieldMarkedWithAnotherFoo.|-7885823532742642204[0] +final var non_public_markers.test/propertyFieldMarkedWithBar // non_public_markers.test/propertyFieldMarkedWithBar|-5109570069593982425[0] + final fun (): kotlin/String // non_public_markers.test/propertyFieldMarkedWithBar.|-4683505128382207138[0] + final fun (kotlin/String) // non_public_markers.test/propertyFieldMarkedWithBar.|2337043424600902160[0] final var non_public_markers.test/propertyGetterMarkedWithAnotherBar // non_public_markers.test/propertyGetterMarkedWithAnotherBar|-8321084504405299502[0] final fun (kotlin/String) // non_public_markers.test/propertyGetterMarkedWithAnotherBar.|1952287206559835979[0] final var non_public_markers.test/propertyGetterMarkedWithAnotherFoo // non_public_markers.test/propertyGetterMarkedWithAnotherFoo|839569568647204104[0] diff --git a/compiler/testData/klib/dump-abi/content/with_non_public_markers_5.v2.txt b/compiler/testData/klib/dump-abi/content/with_non_public_markers_5.v2.txt index eac1da9b2cb..481c9658793 100644 --- a/compiler/testData/klib/dump-abi/content/with_non_public_markers_5.v2.txt +++ b/compiler/testData/klib/dump-abi/content/with_non_public_markers_5.v2.txt @@ -92,6 +92,12 @@ final class non_public_markers.test/NonMarkedClass { // non_public_markers.test/ final var non_public_markers.test/nonMarkedProperty // non_public_markers.test/nonMarkedProperty|{}nonMarkedProperty[0] final fun (): kotlin/String // non_public_markers.test/nonMarkedProperty.|(){}[0] final fun (kotlin/String) // non_public_markers.test/nonMarkedProperty.|(kotlin.String){}[0] +final var non_public_markers.test/propertyFieldMarkedWithAnotherFoo // non_public_markers.test/propertyFieldMarkedWithAnotherFoo|{}propertyFieldMarkedWithAnotherFoo[0] + final fun (): kotlin/String // non_public_markers.test/propertyFieldMarkedWithAnotherFoo.|(){}[0] + final fun (kotlin/String) // non_public_markers.test/propertyFieldMarkedWithAnotherFoo.|(kotlin.String){}[0] +final var non_public_markers.test/propertyFieldMarkedWithBar // non_public_markers.test/propertyFieldMarkedWithBar|{}propertyFieldMarkedWithBar[0] + final fun (): kotlin/String // non_public_markers.test/propertyFieldMarkedWithBar.|(){}[0] + final fun (kotlin/String) // non_public_markers.test/propertyFieldMarkedWithBar.|(kotlin.String){}[0] final var non_public_markers.test/propertyGetterMarkedWithAnotherBar // non_public_markers.test/propertyGetterMarkedWithAnotherBar|{}propertyGetterMarkedWithAnotherBar[0] final fun (kotlin/String) // non_public_markers.test/propertyGetterMarkedWithAnotherBar.|(kotlin.String){}[0] final var non_public_markers.test/propertyGetterMarkedWithAnotherFoo // non_public_markers.test/propertyGetterMarkedWithAnotherFoo|{}propertyGetterMarkedWithAnotherFoo[0] diff --git a/compiler/util-klib-abi/src/org/jetbrains/kotlin/library/abi/LibraryAbi.kt b/compiler/util-klib-abi/src/org/jetbrains/kotlin/library/abi/LibraryAbi.kt index 05fbb800552..17dfa017902 100644 --- a/compiler/util-klib-abi/src/org/jetbrains/kotlin/library/abi/LibraryAbi.kt +++ b/compiler/util-klib-abi/src/org/jetbrains/kotlin/library/abi/LibraryAbi.kt @@ -170,6 +170,18 @@ data class AbiQualifiedName(val packageName: AbiCompoundName, val relativeName: } } +/** + * The common interface for entities that can have annotations. + */ +@ExperimentalLibraryAbiReader +interface AbiAnnotatedEntity { + /** + * Annotations are not a part of ABI. But sometimes it is useful to have the ability to check if some declaration + * has a specific annotation. See [AbiReadingFilter.NonPublicMarkerAnnotations] as an example. + */ + fun hasAnnotation(annotationClassName: AbiQualifiedName): Boolean +} + /** * The common interface for all declarations. * @@ -177,15 +189,9 @@ data class AbiQualifiedName(val packageName: AbiCompoundName, val relativeName: * @property signatures The set of signatures of the declaration. */ @ExperimentalLibraryAbiReader -sealed interface AbiDeclaration { +sealed interface AbiDeclaration : AbiAnnotatedEntity { val qualifiedName: AbiQualifiedName val signatures: AbiSignatures - - /** - * Annotations are not a part of ABI. But sometimes it is useful to have the ability to check if some declaration - * has a specific annotation. See [AbiReadingFilter.NonPublicMarkerAnnotations] as an example. - */ - fun hasAnnotation(annotationClassName: AbiQualifiedName): Boolean } /** @@ -302,16 +308,27 @@ interface AbiValueParameter { * An [AbiDeclaration] that represents a property. * * @property kind The property kind. - * @property getter The getter accessor, fi any. - * @property setter The setter accessor, fi any. + * @property getter The getter accessor, if any. + * @property setter The setter accessor, if any. + * @property backingField The backing field, if any. */ @ExperimentalLibraryAbiReader interface AbiProperty : AbiDeclarationWithModality { val kind: AbiPropertyKind val getter: AbiFunction? val setter: AbiFunction? + val backingField: AbiField? } +/** + * An entity that represents a field. + * + * Since fields are not a part of ABI, [AbiField] is not inherited from [AbiDeclaration]. And consequently don't have + * such attributes as [AbiDeclaration.qualifiedName] or [AbiDeclaration.signatures]. + */ +@ExperimentalLibraryAbiReader +interface AbiField : AbiAnnotatedEntity + /** All known kinds of properties. */ @ExperimentalLibraryAbiReader enum class AbiPropertyKind { VAL, CONST_VAL, VAR } diff --git a/compiler/util-klib-abi/src/org/jetbrains/kotlin/library/abi/LibraryAbiReader.kt b/compiler/util-klib-abi/src/org/jetbrains/kotlin/library/abi/LibraryAbiReader.kt index 6c36ec0d591..2ff28de23f8 100644 --- a/compiler/util-klib-abi/src/org/jetbrains/kotlin/library/abi/LibraryAbiReader.kt +++ b/compiler/util-klib-abi/src/org/jetbrains/kotlin/library/abi/LibraryAbiReader.kt @@ -65,7 +65,11 @@ interface AbiReadingFilter { override fun isDeclarationExcluded(declaration: AbiDeclaration): Boolean { for (nonPublicMarkerName in nonPublicMarkerNames) { - if (declaration.hasAnnotation(nonPublicMarkerName)) return true + if (declaration.hasAnnotation(nonPublicMarkerName) + || (declaration as? AbiProperty)?.backingField?.hasAnnotation(nonPublicMarkerName) == true + ) { + return true + } } return false } diff --git a/compiler/util-klib-abi/src/org/jetbrains/kotlin/library/abi/impl/LibraryAbiImpl.kt b/compiler/util-klib-abi/src/org/jetbrains/kotlin/library/abi/impl/LibraryAbiImpl.kt index 0810da21068..e350ac544fa 100644 --- a/compiler/util-klib-abi/src/org/jetbrains/kotlin/library/abi/impl/LibraryAbiImpl.kt +++ b/compiler/util-klib-abi/src/org/jetbrains/kotlin/library/abi/impl/LibraryAbiImpl.kt @@ -190,7 +190,8 @@ internal class AbiPropertyImpl( modality: AbiModality, kind: AbiPropertyKind, override val getter: AbiFunction?, - override val setter: AbiFunction? + override val setter: AbiFunction?, + override val backingField: AbiField? ) : AbiProperty { private val flags = MODALITY.toFlags(modality) or PROPERTY_KIND.toFlags(kind) @@ -204,6 +205,11 @@ internal class AbiPropertyImpl( } } +@ExperimentalLibraryAbiReader +internal class AbiFieldImpl(private val annotations: Set) : AbiField { + override fun hasAnnotation(annotationClassName: AbiQualifiedName) = annotationClassName in annotations +} + @ExperimentalLibraryAbiReader internal class AbiTypeParameterImpl( override val tag: String, diff --git a/compiler/util-klib-abi/src/org/jetbrains/kotlin/library/abi/impl/LibraryAbiReaderImpl.kt b/compiler/util-klib-abi/src/org/jetbrains/kotlin/library/abi/impl/LibraryAbiReaderImpl.kt index 21a62065502..7a561ad8fcc 100644 --- a/compiler/util-klib-abi/src/org/jetbrains/kotlin/library/abi/impl/LibraryAbiReaderImpl.kt +++ b/compiler/util-klib-abi/src/org/jetbrains/kotlin/library/abi/impl/LibraryAbiReaderImpl.kt @@ -423,6 +423,9 @@ private class LibraryDeserializer( containingEntity = thisPropertyEntity, parentTypeParameterResolver = typeParameterResolver ).discardIfExcluded() + }, + backingField = proto.hasBackingField().ifTrue { + AbiFieldImpl(deserializeAnnotations(proto.backingField.base)) } ) } diff --git a/compiler/util-klib-abi/test/org/jetbrains/kotlin/library/abi/handlers/LibraryAbiDumpHandler.kt b/compiler/util-klib-abi/test/org/jetbrains/kotlin/library/abi/handlers/LibraryAbiDumpHandler.kt index b82859eb09b..d910df616c3 100644 --- a/compiler/util-klib-abi/test/org/jetbrains/kotlin/library/abi/handlers/LibraryAbiDumpHandler.kt +++ b/compiler/util-klib-abi/test/org/jetbrains/kotlin/library/abi/handlers/LibraryAbiDumpHandler.kt @@ -41,7 +41,7 @@ class LibraryAbiDumpHandler(testServices: TestServices) : BinaryArtifactHandler< ) for ((abiSignatureVersion, dumper) in dumpers) { - LibraryAbiRenderer.render(libraryAbi, dumper.builderForModule(module), AbiRenderingSettings(abiSignatureVersion)) + LibraryAbiRenderer.render(libraryAbi, dumper.builderForModule(module), AbiRenderingSettings(abiSignatureVersion)) } }