Create new HidesMembers annotation
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
// !CHECK_TYPE
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
|
||||
|
||||
// FILE: 2.kt
|
||||
package b
|
||||
|
||||
import a.A
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
@kotlin.internal.HidesMembers
|
||||
fun A.forEach(i: Int) = i
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
@kotlin.internal.HidesMembers
|
||||
fun A.forEach(s: String) {}
|
||||
|
||||
|
||||
// FILE: 1.kt
|
||||
package a
|
||||
|
||||
import b.*
|
||||
|
||||
class A {
|
||||
fun forEach() = this
|
||||
fun forEach(i: Int) = this
|
||||
fun forEach(i: String) = this
|
||||
}
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
@kotlin.internal.HidesMembers
|
||||
fun A.forEach() = ""
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
@kotlin.internal.HidesMembers
|
||||
fun A.forEach(s: String) {}
|
||||
|
||||
fun test(a: A) {
|
||||
a.forEach() checkType { _<String>() }
|
||||
|
||||
a.forEach(1) checkType { _<Int>() }
|
||||
|
||||
a.<!OVERLOAD_RESOLUTION_AMBIGUITY!>forEach<!>("")
|
||||
|
||||
with(a) {
|
||||
forEach() checkType { _<String>() }
|
||||
|
||||
forEach(1) checkType { _<Int>() }
|
||||
|
||||
<!OVERLOAD_RESOLUTION_AMBIGUITY!>forEach<!>("")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package
|
||||
|
||||
package a {
|
||||
public fun test(/*0*/ a: a.A): kotlin.Unit
|
||||
@kotlin.Suppress(names = {"INVISIBLE_MEMBER", "INVISIBLE_REFERENCE"}) @kotlin.internal.HidesMembers() public fun a.A.forEach(): kotlin.String
|
||||
@kotlin.Suppress(names = {"INVISIBLE_MEMBER", "INVISIBLE_REFERENCE"}) @kotlin.internal.HidesMembers() public fun a.A.forEach(/*0*/ s: kotlin.String): kotlin.Unit
|
||||
|
||||
public final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun forEach(): a.A
|
||||
public final fun forEach(/*0*/ i: kotlin.Int): a.A
|
||||
public final fun forEach(/*0*/ i: kotlin.String): a.A
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
package b {
|
||||
@kotlin.Suppress(names = {"INVISIBLE_MEMBER", "INVISIBLE_REFERENCE"}) @kotlin.internal.HidesMembers() public fun a.A.forEach(/*0*/ i: kotlin.Int): kotlin.Int
|
||||
@kotlin.Suppress(names = {"INVISIBLE_MEMBER", "INVISIBLE_REFERENCE"}) @kotlin.internal.HidesMembers() public fun a.A.forEach(/*0*/ s: kotlin.String): kotlin.Unit
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
// !CHECK_TYPE
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
|
||||
class A {
|
||||
fun forEach() = this
|
||||
fun forEach(i: Int) = this
|
||||
}
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
@kotlin.internal.HidesMembers
|
||||
fun A.forEach(i: Int) = i
|
||||
|
||||
class B {
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
@kotlin.internal.HidesMembers
|
||||
fun A.forEach() = this@B
|
||||
|
||||
fun test(a: A) {
|
||||
a.forEach() checkType { _<A>() } // todo
|
||||
|
||||
with(a) {
|
||||
forEach() checkType { _<A>() } // todo
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun test2(a: A) {
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
@kotlin.internal.HidesMembers
|
||||
fun A.forEach() = ""
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
@kotlin.internal.HidesMembers
|
||||
fun A.forEach(i: Int) = ""
|
||||
|
||||
a.forEach() checkType { _<String>() }
|
||||
a.<!OVERLOAD_RESOLUTION_AMBIGUITY!>forEach<!>(1)
|
||||
|
||||
with(a) {
|
||||
forEach() checkType { _<String>() }
|
||||
<!OVERLOAD_RESOLUTION_AMBIGUITY!>forEach<!>(1)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package
|
||||
|
||||
public fun test2(/*0*/ a: A): kotlin.Unit
|
||||
@kotlin.Suppress(names = {"INVISIBLE_MEMBER", "INVISIBLE_REFERENCE"}) @kotlin.internal.HidesMembers() public fun A.forEach(/*0*/ i: kotlin.Int): kotlin.Int
|
||||
|
||||
public final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun forEach(): A
|
||||
public final fun forEach(/*0*/ i: kotlin.Int): A
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public 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 final fun test(/*0*/ a: A): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
@kotlin.Suppress(names = {"INVISIBLE_MEMBER", "INVISIBLE_REFERENCE"}) @kotlin.internal.HidesMembers() public final fun A.forEach(): B
|
||||
}
|
||||
Reference in New Issue
Block a user