K1: add deprecation for implicit non-public calls #KT-54762 Fixed
This commit is contained in:
committed by
Space Team
parent
f4b5f5ff5d
commit
ac514849f4
@@ -0,0 +1,42 @@
|
||||
// !DIAGNOSTICS: -NOTHING_TO_INLINE
|
||||
|
||||
@PublishedApi
|
||||
internal class InternalClassPrivateConstructor private constructor() {
|
||||
companion object {
|
||||
internal inline operator fun invoke(): InternalClassPrivateConstructor = InternalClassPrivateConstructor()
|
||||
|
||||
internal inline operator fun invoke(i: Int): InternalClassPrivateConstructor = <!RECURSION_IN_INLINE!>InternalClassPrivateConstructor<!>(i)
|
||||
}
|
||||
}
|
||||
|
||||
private class PrivateClass public constructor() {
|
||||
|
||||
operator fun invoke() = 42
|
||||
}
|
||||
|
||||
open class OpenClass {
|
||||
|
||||
protected operator fun invoke() = 42
|
||||
|
||||
inline fun foo() {
|
||||
<!PROTECTED_CALL_FROM_PUBLIC_INLINE_ERROR!>this<!>()
|
||||
}
|
||||
}
|
||||
|
||||
@PublishedApi
|
||||
internal open class InternalClassProtectedConstructor protected constructor() {
|
||||
companion object {
|
||||
internal inline operator fun invoke(): InternalClassProtectedConstructor = InternalClassProtectedConstructor()
|
||||
}
|
||||
}
|
||||
|
||||
inline fun publicInline() {
|
||||
<!NON_PUBLIC_CALL_FROM_PUBLIC_INLINE!>InternalClassPrivateConstructor<!>()
|
||||
InternalClassPrivateConstructor.<!NON_PUBLIC_CALL_FROM_PUBLIC_INLINE!>invoke<!>()
|
||||
<!NON_PUBLIC_CALL_FROM_PUBLIC_INLINE!>InternalClassProtectedConstructor<!>()
|
||||
}
|
||||
|
||||
internal inline fun internalInline() {
|
||||
val pc = <!PRIVATE_CLASS_MEMBER_FROM_INLINE!>PrivateClass<!>()
|
||||
<!PRIVATE_CLASS_MEMBER_FROM_INLINE!>pc<!>()
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
// !DIAGNOSTICS: -NOTHING_TO_INLINE
|
||||
|
||||
@PublishedApi
|
||||
internal class InternalClassPrivateConstructor private constructor() {
|
||||
companion object {
|
||||
internal inline operator fun invoke(): InternalClassPrivateConstructor = InternalClassPrivateConstructor()
|
||||
|
||||
internal inline operator fun invoke(i: Int): InternalClassPrivateConstructor = <!DEPRECATED_IMPLICIT_NON_PUBLIC_API_ACCESS!>InternalClassPrivateConstructor<!>(i)
|
||||
}
|
||||
}
|
||||
|
||||
private class PrivateClass public constructor() {
|
||||
|
||||
operator fun invoke() = 42
|
||||
}
|
||||
|
||||
open class OpenClass {
|
||||
|
||||
protected operator fun invoke() = 42
|
||||
|
||||
inline fun foo() {
|
||||
<!DEPRECATED_IMPLICIT_NON_PUBLIC_API_ACCESS!>this<!>()
|
||||
}
|
||||
}
|
||||
|
||||
@PublishedApi
|
||||
internal open class InternalClassProtectedConstructor protected constructor() {
|
||||
companion object {
|
||||
internal inline operator fun invoke(): InternalClassProtectedConstructor = InternalClassProtectedConstructor()
|
||||
}
|
||||
}
|
||||
|
||||
inline fun publicInline() {
|
||||
<!DEPRECATED_IMPLICIT_NON_PUBLIC_API_ACCESS!>InternalClassPrivateConstructor<!>()
|
||||
InternalClassPrivateConstructor.<!NON_PUBLIC_CALL_FROM_PUBLIC_INLINE!>invoke<!>()
|
||||
<!DEPRECATED_IMPLICIT_NON_PUBLIC_API_ACCESS!>InternalClassProtectedConstructor<!>()
|
||||
}
|
||||
|
||||
internal inline fun internalInline() {
|
||||
val pc = <!PRIVATE_CLASS_MEMBER_FROM_INLINE!>PrivateClass<!>()
|
||||
<!DEPRECATED_IMPLICIT_NON_PUBLIC_API_ACCESS!>pc<!>()
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package
|
||||
|
||||
internal inline fun internalInline(): kotlin.Unit
|
||||
public inline fun publicInline(): kotlin.Unit
|
||||
|
||||
@kotlin.PublishedApi internal final class InternalClassPrivateConstructor {
|
||||
private constructor InternalClassPrivateConstructor()
|
||||
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 companion object Companion {
|
||||
private constructor Companion()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
internal final inline operator fun invoke(): InternalClassPrivateConstructor
|
||||
internal final inline operator fun invoke(/*0*/ i: kotlin.Int): InternalClassPrivateConstructor
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
@kotlin.PublishedApi internal open class InternalClassProtectedConstructor {
|
||||
protected constructor InternalClassProtectedConstructor()
|
||||
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 companion object Companion {
|
||||
private constructor Companion()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
internal final inline operator fun invoke(): InternalClassProtectedConstructor
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
public open class OpenClass {
|
||||
public constructor OpenClass()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final inline fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
protected final operator fun invoke(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
private final class PrivateClass {
|
||||
public constructor PrivateClass()
|
||||
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 final operator fun invoke(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user