[FIR] Report deprecations in qualified expressions

This commit is contained in:
Andrey Zinovyev
2021-07-16 16:54:06 +03:00
committed by TeamCityServer
parent 98bd6f5d3e
commit 8a0941a85a
32 changed files with 132 additions and 119 deletions
@@ -1,32 +0,0 @@
class Another {
@Deprecated("Object")
companion object {
fun use() {}
const val USE = 42
}
}
fun first() {
Another.use()
Another.Companion.USE
Another.USE
}
fun useCompanion() {
val d = Another
val x = Another.Companion
Another.Companion.use()
Another.use()
}
@Deprecated("Some")
class Some {
companion object {
fun use() {}
}
}
fun some() {
Some.use()
Some.Companion.use()
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
class Another {
@Deprecated("Object")
companion object {
@@ -10,4 +10,4 @@ public interface J {
// FILE: K.kt
import test.J
import <!DEPRECATION!>test.J<!>
@@ -1,8 +0,0 @@
import C as C2
@Deprecated("obsolete")
class C {
fun use() {}
}
fun useAlias(c : <!DEPRECATION!>C2<!>) { c.use() }
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
import <!DEPRECATION!>C<!> as C2
@Deprecated("obsolete")
@@ -1,18 +0,0 @@
class TopLevel {
@Deprecated("Nested")
class Nested {
companion object {
fun use() {}
class CompanionNested2
}
class Nested2
}
}
fun useNested() {
val d = TopLevel.Nested.use()
TopLevel.Nested.Nested2()
TopLevel.Nested.<!UNRESOLVED_REFERENCE!>CompanionNested2<!>()
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
class TopLevel {
@Deprecated("Nested")
class Nested {
@@ -1,9 +0,0 @@
@Deprecated("Object")
object Obsolete {
fun use() {}
}
fun useObject() {
Obsolete.use()
val x = Obsolete
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
@Deprecated("Object")
object Obsolete {
fun use() {}
@@ -1,12 +0,0 @@
class Relevant {
companion object {
val value = ""
}
}
@Deprecated("Use Relevant")
typealias Obsolete = Relevant
fun test1() = Obsolete
fun test2() = Obsolete.value
fun test3() = Obsolete.toString()
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
class Relevant {
companion object {
val value = ""
@@ -16,7 +16,7 @@ fun test1a(x: List<<!DEPRECATION!>Obsolete<!>>) = x
val test2 = Obsolete()
val test3 = Obsolete
val test3 = <!DEPRECATION!>Obsolete<!>
class Test4: <!DEPRECATION!>Obsolete<!>()
class Test4a: <!DEPRECATION!>IObsolete<!>
@@ -7,4 +7,4 @@ interface A
// FILE: B.kt
import test.A
import <!DEPRECATION!>test.A<!>
@@ -28,7 +28,7 @@ fun test(a: <!UNRESOLVED_REFERENCE!>A<!>) {
}
// FILE: explicitlyImportP1.kt
import p1.A
import <!DEPRECATION_ERROR!>p1.A<!>
import p2.*
fun test(a: <!DEPRECATION_ERROR!>A<!>) {
@@ -25,7 +25,7 @@ class A(val v3: Unit)
// MODULE: m4(m1, m2, m3)
// FILE: oneExplicitImportOtherStars.kt
import p1.*
import p2.A
import <!DEPRECATION_ERROR!>p2.A<!>
import p3.*
fun test(a: <!DEPRECATION_ERROR!>A<!>) {