[FIR] Use @DeprecatedSinceKotlin in the resolution

This commit is contained in:
Andrey Zinovyev
2021-06-17 12:26:31 +03:00
committed by teamcityserver
parent b64f7909b8
commit 9fad55d551
22 changed files with 241 additions and 62 deletions
@@ -0,0 +1,29 @@
// TARGET_BACKEND: JVM
// WITH_STDLIB
// MODULE: lib
// FILE: A.kt
package kotlin.test
@JvmName("contentEqualsNullable")
public inline infix fun <T> Array<out T>?.contentEqualsMy(other: Array<out T>?): Boolean {
return java.util.Arrays.equals(this, other)
}
@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.")
@DeprecatedSinceKotlin(hiddenSince = "1.4")
public inline infix fun <T> Array<out T>.contentEqualsMy(other: Array<out T>): Boolean {
return this.contentEqualsMy(other)
}
// MODULE: main(lib)
// FILE: B.kt
import kotlin.test.*
fun box(): String {
val arr = arrayOf(1, 2, 3)
return if (arr contentEqualsMy arr) "OK" else "fail"
}
@@ -1,26 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
package kotlin
object Scope {
fun foo(): Int = 0
object Nested {
@Deprecated("err")
@DeprecatedSinceKotlin(hiddenSince = "1.0")
fun foo(): String = ""
fun <T> take(f: () -> T): T = f()
fun test() {
val r1 = take(::foo)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>r1<!>
val r2 = ::foo
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.reflect.KFunction0<kotlin.String>")!>r2<!>
val r3 = foo()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>r3<!>
}
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
package kotlin
@@ -28,7 +28,7 @@ val valNext = Unit
fun usage() {
ClassCur()
funCur()
<!INVISIBLE_REFERENCE!>funCur<!>()
valCur
ClassNext()