Updated NON_PUBLIC_CALL_FROM_PUBLIC_INLINE diagnostic to support @PublishedApi
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
// !DIAGNOSTICS: -EXPOSED_PARAMETER_TYPE -NOTHING_TO_INLINE
|
||||
|
||||
|
||||
inline fun call(a: A) {
|
||||
a.<!NON_PUBLIC_CALL_FROM_PUBLIC_INLINE!>test<!>()
|
||||
|
||||
<!NON_PUBLIC_CALL_FROM_PUBLIC_INLINE!>privateFun<!>()
|
||||
|
||||
<!NON_PUBLIC_CALL_FROM_PUBLIC_INLINE!>internalFun<!>()
|
||||
}
|
||||
|
||||
@PublishedApi
|
||||
internal inline fun callFromPublishedApi(a: A) {
|
||||
a.<!NON_PUBLIC_CALL_FROM_PUBLIC_INLINE!>test<!>()
|
||||
|
||||
<!NON_PUBLIC_CALL_FROM_PUBLIC_INLINE!>privateFun<!>()
|
||||
|
||||
<!NON_PUBLIC_CALL_FROM_PUBLIC_INLINE!>internalFun<!>()
|
||||
}
|
||||
|
||||
internal class A {
|
||||
@PublishedApi
|
||||
internal fun test() {
|
||||
test()
|
||||
|
||||
privateFun()
|
||||
|
||||
internalFun()
|
||||
}
|
||||
|
||||
@PublishedApi
|
||||
internal fun testInline() {
|
||||
test()
|
||||
|
||||
privateFun()
|
||||
|
||||
internalFun()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun privateFun() {
|
||||
|
||||
}
|
||||
|
||||
internal fun internalFun() {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package
|
||||
|
||||
public inline fun call(/*0*/ a: A): kotlin.Unit
|
||||
@kotlin.PublishedApi internal inline fun callFromPublishedApi(/*0*/ a: A): kotlin.Unit
|
||||
internal fun internalFun(): kotlin.Unit
|
||||
private fun privateFun(): kotlin.Unit
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@kotlin.PublishedApi internal final fun test(): kotlin.Unit
|
||||
@kotlin.PublishedApi internal final fun testInline(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
// !DIAGNOSTICS: -EXPOSED_PARAMETER_TYPE -NOTHING_TO_INLINE
|
||||
inline fun call(a: A) {
|
||||
a.test()
|
||||
testTopLevel()
|
||||
}
|
||||
|
||||
@PublishedApi
|
||||
internal class A {
|
||||
@PublishedApi
|
||||
internal fun test() {
|
||||
publicFun()
|
||||
internalFun()
|
||||
privateFun()
|
||||
}
|
||||
|
||||
@PublishedApi
|
||||
internal inline fun testInline() {
|
||||
publicFun()
|
||||
<!NON_PUBLIC_CALL_FROM_PUBLIC_INLINE!>internalFun<!>()
|
||||
<!NON_PUBLIC_CALL_FROM_PUBLIC_INLINE!>privateFun<!>()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@PublishedApi
|
||||
internal fun testTopLevel() {
|
||||
publicFun()
|
||||
internalFun()
|
||||
}
|
||||
|
||||
@PublishedApi
|
||||
inline internal fun testTopLevelInline() {
|
||||
publicFun()
|
||||
<!NON_PUBLIC_CALL_FROM_PUBLIC_INLINE!>internalFun<!>()
|
||||
<!NON_PUBLIC_CALL_FROM_PUBLIC_INLINE!>privateFun<!>()
|
||||
}
|
||||
|
||||
fun publicFun() {}
|
||||
|
||||
internal fun internalFun() {}
|
||||
|
||||
private fun privateFun() {}
|
||||
@@ -0,0 +1,17 @@
|
||||
package
|
||||
|
||||
public inline fun call(/*0*/ a: A): kotlin.Unit
|
||||
internal fun internalFun(): kotlin.Unit
|
||||
private fun privateFun(): kotlin.Unit
|
||||
public fun publicFun(): kotlin.Unit
|
||||
@kotlin.PublishedApi internal fun testTopLevel(): kotlin.Unit
|
||||
@kotlin.PublishedApi internal inline fun testTopLevelInline(): kotlin.Unit
|
||||
|
||||
@kotlin.PublishedApi internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@kotlin.PublishedApi internal final fun test(): kotlin.Unit
|
||||
@kotlin.PublishedApi internal final inline fun testInline(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -NOTHING_TO_INLINE
|
||||
// MODULE: m1
|
||||
// FILE: a.kt
|
||||
|
||||
package p
|
||||
|
||||
public class A {
|
||||
@PublishedApi
|
||||
internal val a = A()
|
||||
@PublishedApi
|
||||
internal var v = A()
|
||||
@PublishedApi
|
||||
internal fun a() = A()
|
||||
@PublishedApi
|
||||
internal inner class B
|
||||
}
|
||||
|
||||
@PublishedApi
|
||||
internal val a = A()
|
||||
@PublishedApi
|
||||
internal var v = A()
|
||||
@PublishedApi
|
||||
internal fun a() = A()
|
||||
@PublishedApi
|
||||
internal class B
|
||||
|
||||
// MODULE: m2(m1)
|
||||
// FILE: b.kt
|
||||
|
||||
import p.*
|
||||
|
||||
fun test() {
|
||||
val _a = <!INVISIBLE_MEMBER!>a<!>
|
||||
val _v = <!INVISIBLE_MEMBER!>v<!>
|
||||
<!INVISIBLE_MEMBER!>a<!>()
|
||||
<!INVISIBLE_MEMBER!>B<!>()
|
||||
|
||||
val inst = A()
|
||||
val ia = inst.<!INVISIBLE_MEMBER!>a<!>
|
||||
val iv = inst.<!INVISIBLE_MEMBER!>v<!>
|
||||
inst.<!INVISIBLE_MEMBER!>a<!>()
|
||||
inst.<!INVISIBLE_MEMBER!>B<!>()
|
||||
}
|
||||
|
||||
inline fun testInline() {
|
||||
val _a = <!INVISIBLE_MEMBER!>a<!>
|
||||
val _v = <!INVISIBLE_MEMBER!>v<!>
|
||||
<!INVISIBLE_MEMBER!>a<!>()
|
||||
<!INVISIBLE_MEMBER!>B<!>()
|
||||
|
||||
val inst = A()
|
||||
val ia = inst.<!INVISIBLE_MEMBER!>a<!>
|
||||
val iv = inst.<!INVISIBLE_MEMBER!>v<!>
|
||||
inst.<!INVISIBLE_MEMBER!>a<!>()
|
||||
inst.<!INVISIBLE_MEMBER!>B<!>()
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
// -- Module: <m1> --
|
||||
package
|
||||
|
||||
package p {
|
||||
@kotlin.PublishedApi internal val a: p.A
|
||||
@kotlin.PublishedApi internal var v: p.A
|
||||
@kotlin.PublishedApi internal fun a(): p.A
|
||||
|
||||
public final class A {
|
||||
public constructor A()
|
||||
@kotlin.PublishedApi internal final val a: p.A
|
||||
@kotlin.PublishedApi internal final var v: p.A
|
||||
@kotlin.PublishedApi internal final fun a(): p.A
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
@kotlin.PublishedApi internal final inner class B {
|
||||
public constructor B()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
@kotlin.PublishedApi internal final class B {
|
||||
public constructor B()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <m2> --
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
public inline fun testInline(): kotlin.Unit
|
||||
|
||||
package p {
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package
|
||||
|
||||
@kotlin.PublishedApi public var ap: kotlin.Int
|
||||
@kotlin.PublishedApi internal var bp: kotlin.Int
|
||||
@kotlin.PublishedApi internal var c: kotlin.Int
|
||||
@kotlin.PublishedApi public fun a(): kotlin.Unit
|
||||
@kotlin.PublishedApi internal fun b(): kotlin.Unit
|
||||
@kotlin.PublishedApi internal fun c(): kotlin.Unit
|
||||
|
||||
@kotlin.PublishedApi public final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.PublishedApi internal final class B {
|
||||
public constructor B()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.PublishedApi private final class C {
|
||||
public constructor C()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class D {
|
||||
@kotlin.PublishedApi public constructor D()
|
||||
@kotlin.PublishedApi public constructor D(/*0*/ a: kotlin.String)
|
||||
@kotlin.PublishedApi private constructor D(/*0*/ a: kotlin.String, /*1*/ b: kotlin.String)
|
||||
@kotlin.PublishedApi internal constructor D(/*0*/ a: kotlin.String, /*1*/ b: kotlin.String, /*2*/ c: kotlin.String)
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class E {
|
||||
public constructor E()
|
||||
@kotlin.PublishedApi public final val ap: kotlin.Int = 1
|
||||
@kotlin.PublishedApi internal final val bp: kotlin.Int = 1
|
||||
@kotlin.PublishedApi protected final val c: kotlin.Int = 1
|
||||
@kotlin.PublishedApi private final val d: kotlin.Int = 1
|
||||
@kotlin.PublishedApi public final fun a(): kotlin.Unit
|
||||
@kotlin.PublishedApi internal final fun b(): kotlin.Unit
|
||||
@kotlin.PublishedApi private final fun c(): kotlin.Unit
|
||||
@kotlin.PublishedApi protected final fun d(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user