Files
kotlin-fork/compiler/testData/diagnostics/tests/inline/nonPublicMember/inPublicClass.kt
T
Dmitriy Novozhilov 32c3f85679 [FIR] Add inline checker for bodies of inline functions
This checker doesn't support `@PublishedAPI` yet, so some BB tests for it
 were muted. #KT-46270
2021-04-27 18:39:09 +03:00

38 lines
803 B
Kotlin
Vendored

// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE
public class Z {
internal val privateProperty = 11;
internal fun privateFun() {
}
}
public inline fun test() {
Z().<!NON_PUBLIC_CALL_FROM_PUBLIC_INLINE!>privateProperty<!>
Z().<!NON_PUBLIC_CALL_FROM_PUBLIC_INLINE!>privateFun<!>()
}
internal inline fun testInternal() {
Z().privateProperty
Z().privateFun()
}
public class Z2 {
private val privateProperty = 11;
private fun privateFun() {
}
public inline fun test() {
<!NON_PUBLIC_CALL_FROM_PUBLIC_INLINE!>privateProperty<!>
<!NON_PUBLIC_CALL_FROM_PUBLIC_INLINE!>privateFun<!>()
}
internal inline fun testInternal() {
privateProperty
privateFun()
}
}