Inline visibility checking
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
|
||||
private class Z public (){
|
||||
public val publicProperty:Int = 12
|
||||
public fun publicFun() {}
|
||||
}
|
||||
|
||||
public inline fun test() {
|
||||
<!INVISIBLE_MEMBER_FROM_INLINE!>Z<!>().<!INVISIBLE_MEMBER_FROM_INLINE!>publicProperty<!>
|
||||
<!INVISIBLE_MEMBER_FROM_INLINE!>Z<!>().<!INVISIBLE_MEMBER_FROM_INLINE!>publicFun<!>()
|
||||
}
|
||||
|
||||
inline fun testInternal() {
|
||||
Z().publicProperty
|
||||
Z().publicFun()
|
||||
}
|
||||
|
||||
private class Z2 {
|
||||
private val privateProperty = 11;
|
||||
|
||||
public val publicProperty:Int = 12
|
||||
|
||||
private fun privateFun() {}
|
||||
|
||||
public fun publicFun() {}
|
||||
|
||||
public inline fun test() {
|
||||
privateProperty
|
||||
privateFun()
|
||||
publicProperty
|
||||
publicFun()
|
||||
Z2().publicProperty
|
||||
Z2().publicFun()
|
||||
Z2().privateProperty
|
||||
Z2().privateFun()
|
||||
}
|
||||
|
||||
inline fun testInternal() {
|
||||
privateProperty
|
||||
privateFun()
|
||||
publicProperty
|
||||
publicFun()
|
||||
Z2().publicProperty
|
||||
Z2().publicFun()
|
||||
Z2().privateProperty
|
||||
Z2().privateFun()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
|
||||
private class Z2 {
|
||||
private val privateProperty = 11;
|
||||
|
||||
public val publicProperty:Int = 12
|
||||
|
||||
private fun privateFun() {}
|
||||
|
||||
public fun publicFun() {}
|
||||
|
||||
private inner class ZInner {
|
||||
public inline fun test() {
|
||||
privateProperty
|
||||
privateFun()
|
||||
publicFun()
|
||||
publicProperty
|
||||
|
||||
Z2().publicProperty
|
||||
Z2().publicFun()
|
||||
Z2().privateProperty
|
||||
Z2().privateFun()
|
||||
}
|
||||
|
||||
inline fun testInternal() {
|
||||
privateProperty
|
||||
privateFun()
|
||||
publicFun()
|
||||
publicProperty
|
||||
|
||||
Z2().publicProperty
|
||||
Z2().publicFun()
|
||||
Z2().privateProperty
|
||||
Z2().privateFun()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
|
||||
|
||||
private val privateProperty = 11;
|
||||
private fun privateFun() {}
|
||||
|
||||
val internalProperty = 11;
|
||||
fun internalFun() {}
|
||||
|
||||
public inline fun test() {
|
||||
<!INVISIBLE_MEMBER_FROM_INLINE!>privateFun<!>()
|
||||
<!INVISIBLE_MEMBER_FROM_INLINE!>privateProperty<!>
|
||||
}
|
||||
|
||||
public inline fun test2() {
|
||||
<!INVISIBLE_MEMBER_FROM_INLINE!>internalFun<!>()
|
||||
<!INVISIBLE_MEMBER_FROM_INLINE!>internalProperty<!>
|
||||
}
|
||||
|
||||
inline fun testInternal() {
|
||||
privateFun()
|
||||
privateProperty
|
||||
}
|
||||
|
||||
inline fun test2Internal() {
|
||||
internalFun()
|
||||
internalProperty
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
|
||||
public class Z {
|
||||
val privateProperty = 11;
|
||||
|
||||
fun privateFun() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public inline fun test() {
|
||||
Z().<!INVISIBLE_MEMBER_FROM_INLINE!>privateProperty<!>
|
||||
Z().<!INVISIBLE_MEMBER_FROM_INLINE!>privateFun<!>()
|
||||
}
|
||||
|
||||
inline fun testInternal() {
|
||||
Z().privateProperty
|
||||
Z().privateFun()
|
||||
}
|
||||
|
||||
|
||||
public class Z2 {
|
||||
private val privateProperty = 11;
|
||||
|
||||
private fun privateFun() {
|
||||
|
||||
}
|
||||
|
||||
public inline fun test() {
|
||||
<!INVISIBLE_MEMBER_FROM_INLINE!>privateProperty<!>
|
||||
<!INVISIBLE_MEMBER_FROM_INLINE!>privateFun<!>()
|
||||
}
|
||||
|
||||
inline fun testInternal() {
|
||||
privateProperty
|
||||
privateFun()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -NOTHING_TO_INLINE
|
||||
|
||||
public class Z {
|
||||
private val privateProperty = 11;
|
||||
|
||||
public fun privateFun() {
|
||||
|
||||
class Local {
|
||||
public inline fun a() {
|
||||
privateProperty
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user