[K2] Rewrite condition for EXPECTED_PRIVATE_DECLARATION
...without `isTopLevelOrInsideClass` property. Behavior stays the same, because in fact we require all `expect` member declarations to be non-private except constructors and property setter. Enhance already existing test. ^KT-59899
This commit is contained in:
committed by
Space Team
parent
1fdc607898
commit
6112c4ab2c
+8
-2
@@ -1,21 +1,27 @@
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
expect class A {
|
||||
expect class A private constructor() {
|
||||
<!EXPECTED_PRIVATE_DECLARATION!>private<!> fun foo()
|
||||
<!EXPECTED_PRIVATE_DECLARATION!>private<!> val bar: String
|
||||
<!EXPECTED_PRIVATE_DECLARATION!>private<!> fun Int.memExt(): Any
|
||||
|
||||
<!EXPECTED_PRIVATE_DECLARATION!>private<!> class Nested
|
||||
|
||||
var baz: Any?
|
||||
private set
|
||||
}
|
||||
|
||||
// MODULE: m1-jvm()()(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
actual class A {
|
||||
actual class A actual private constructor() {
|
||||
private fun foo() {}
|
||||
private val bar: String = ""
|
||||
actual private fun Int.memExt(): Any = 0
|
||||
|
||||
actual private class Nested
|
||||
|
||||
actual var baz: Any? = null
|
||||
private set
|
||||
}
|
||||
|
||||
+8
-2
@@ -1,21 +1,27 @@
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
expect class A {
|
||||
expect class A private constructor() {
|
||||
<!EXPECTED_PRIVATE_DECLARATION, EXPECTED_PRIVATE_DECLARATION{JVM}!>private<!> fun foo()
|
||||
<!EXPECTED_PRIVATE_DECLARATION, EXPECTED_PRIVATE_DECLARATION{JVM}!>private<!> val bar: String
|
||||
<!EXPECTED_PRIVATE_DECLARATION, EXPECTED_PRIVATE_DECLARATION{JVM}!>private<!> fun Int.memExt(): Any
|
||||
|
||||
<!EXPECTED_PRIVATE_DECLARATION, EXPECTED_PRIVATE_DECLARATION{JVM}!>private<!> class Nested
|
||||
|
||||
var baz: Any?
|
||||
private set
|
||||
}
|
||||
|
||||
// MODULE: m1-jvm()()(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
actual class A {
|
||||
actual class A actual private constructor() {
|
||||
private fun <!ACTUAL_MISSING!>foo<!>() {}
|
||||
private val <!ACTUAL_MISSING!>bar<!>: String = ""
|
||||
actual private fun Int.memExt(): Any = 0
|
||||
|
||||
actual private class Nested
|
||||
|
||||
actual var baz: Any? = null
|
||||
private set
|
||||
}
|
||||
|
||||
+4
-1
@@ -2,7 +2,9 @@
|
||||
package
|
||||
|
||||
public final expect class A {
|
||||
private constructor A()
|
||||
private expect final val bar: kotlin.String
|
||||
public expect final var baz: kotlin.Any?
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
private final expect fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@@ -20,8 +22,9 @@ public final expect class A {
|
||||
package
|
||||
|
||||
public final actual class A {
|
||||
public constructor A()
|
||||
private constructor A()
|
||||
private final val bar: kotlin.String = ""
|
||||
public actual final var baz: kotlin.Any?
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
private final fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
|
||||
Reference in New Issue
Block a user