From c3773d14bbb44da1bdf42982197ee16bc9802da7 Mon Sep 17 00:00:00 2001 From: Victor Petukhov Date: Mon, 27 Sep 2021 10:22:08 +0300 Subject: [PATCH] Revert "[all-open] Don't affect private declarations to change their modality to open" This reverts commit baeee8988ea6d8191c60a8d9f62c4f5f047b0315. --- .../src/AllOpenDeclarationAttributeAltererExtension.kt | 2 +- .../allopen-cli/testData/bytecodeListing/privateMembers.kt | 2 -- .../allopen-cli/testData/bytecodeListing/privateMembers.txt | 5 ++--- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/plugins/allopen/allopen-cli/src/AllOpenDeclarationAttributeAltererExtension.kt b/plugins/allopen/allopen-cli/src/AllOpenDeclarationAttributeAltererExtension.kt index 88dfe826959..a574db29d5c 100644 --- a/plugins/allopen/allopen-cli/src/AllOpenDeclarationAttributeAltererExtension.kt +++ b/plugins/allopen/allopen-cli/src/AllOpenDeclarationAttributeAltererExtension.kt @@ -43,7 +43,7 @@ abstract class AbstractAllOpenDeclarationAttributeAltererExtension : Declaration currentModality: Modality, isImplicitModality: Boolean ): Modality? { - if (currentModality != Modality.FINAL || modifierListOwner.isPrivate()) { + if (currentModality != Modality.FINAL) { return null } diff --git a/plugins/allopen/allopen-cli/testData/bytecodeListing/privateMembers.kt b/plugins/allopen/allopen-cli/testData/bytecodeListing/privateMembers.kt index e22039a07b7..33668e5fcbb 100644 --- a/plugins/allopen/allopen-cli/testData/bytecodeListing/privateMembers.kt +++ b/plugins/allopen/allopen-cli/testData/bytecodeListing/privateMembers.kt @@ -13,6 +13,4 @@ private class Test { internal fun internalMethod() {} internal val internalProp: String = "" - - private tailrec fun privateTailrecMethod() {} } \ No newline at end of file diff --git a/plugins/allopen/allopen-cli/testData/bytecodeListing/privateMembers.txt b/plugins/allopen/allopen-cli/testData/bytecodeListing/privateMembers.txt index f170409bd3e..832296ab5da 100644 --- a/plugins/allopen/allopen-cli/testData/bytecodeListing/privateMembers.txt +++ b/plugins/allopen/allopen-cli/testData/bytecodeListing/privateMembers.txt @@ -6,7 +6,7 @@ public annotation class AllOpen { @AllOpen @kotlin.Metadata -final class Test { +class Test { // source: 'privateMembers.kt' private final @org.jetbrains.annotations.NotNull field internalProp: java.lang.String private final field privateProp: java.lang.String @@ -17,8 +17,7 @@ final class Test { protected @org.jetbrains.annotations.NotNull method getProtectedProp(): java.lang.String public @org.jetbrains.annotations.NotNull method getPublicProp(): java.lang.String public method internalMethod$test_module(): void - private final method privateMethod(): void - private final method privateTailrecMethod(): void + private method privateMethod(): void protected method protectedMethod(): void public method publicMethod(): void }