FIR: handle 'SinceKotlin' as a special kind of deprecated

#KT-51850 Fixed
This commit is contained in:
Mikhail Glukhikh
2022-04-05 12:42:11 +03:00
committed by teamcity
parent 07b5bd72ae
commit 9bd6a9c069
19 changed files with 122 additions and 82 deletions
@@ -1,34 +0,0 @@
// !API_VERSION: 1.0
// MODULE: m1
// FILE: a.kt
package p1
@SinceKotlin("1.1")
fun foo(s: Int): String = s.toString()
// MODULE: m2
// FILE: b.kt
package p2
fun foo(s: Int): Int = s
// MODULE: m3(m1, m2)
// FILE: severalStarImports.kt
import p1.*
import p2.*
fun test1(): Int {
val r = <!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>(42)
return r
}
// FILE: explicitlyImportP1.kt
import p1.foo // TODO: consider reporting API_NOT_AVAILABLE here
import p2.*
fun test2(): Int {
val r = foo(42)
return <!RETURN_TYPE_MISMATCH!>r<!>
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !API_VERSION: 1.0
// MODULE: m1
// FILE: a.kt
@@ -7,5 +7,5 @@ annotation class Anno2 @SinceKotlin("1.1") constructor()
@Anno1("")
@Anno2
@<!UNRESOLVED_REFERENCE!>Anno2<!>
fun t1() {}
@@ -16,8 +16,8 @@ fun t1(): Foo = Foo()
// TODO: do not report API_NOT_AVAILABLE twice
fun t2() = object : Foo() {}
fun t3(): Bar? = Bar()
fun t3(): Bar? = <!UNRESOLVED_REFERENCE!>Bar<!>()
fun t4(): Baz = Baz()
fun t4(): Baz = <!UNRESOLVED_REFERENCE!>Baz<!>()
fun t5(): Quux = Quux()
@@ -18,14 +18,14 @@ interface I11 {
}
fun f1(x: I10) = x.foo()
fun f2(x: I11) = x.foo()
fun f2(x: I11) = x.<!UNRESOLVED_REFERENCE!>foo<!>()
fun f3(x: J) = x.foo()
interface BothI1 : I10, I11
fun f4(x: BothI1) = x.foo()
interface BothI2 : I11, I10
fun f5(x: BothI2) = x.foo()
fun f5(x: BothI2) = x.<!UNRESOLVED_REFERENCE!>foo<!>()
interface JAndI10 : J, I10
fun f6(x: JAndI10) = x.foo()
@@ -34,15 +34,15 @@ val v7: String
get() = ""
fun test() {
v1
v2
v3
<!UNRESOLVED_REFERENCE!>v1<!>
<!UNRESOLVED_REFERENCE!>v2<!>
<!UNRESOLVED_REFERENCE!>v3<!>
v3 = ""
v4
v4 = ""
v5
v5 = ""
v6
v6 = ""
v7
<!UNRESOLVED_REFERENCE!>v4<!> = ""
<!UNRESOLVED_REFERENCE!>v5<!>
<!UNRESOLVED_REFERENCE!>v5<!> = ""
<!UNRESOLVED_REFERENCE!>v6<!>
<!UNRESOLVED_REFERENCE!>v6<!> = ""
<!UNRESOLVED_REFERENCE!>v7<!>
}
@@ -1,19 +0,0 @@
// !API_VERSION: 1.0
@SinceKotlin("1.1")
fun f() {}
@SinceKotlin("1.1")
var p = Unit
@SinceKotlin("1.1.2")
fun z() {}
fun t1() = f()
fun t2() = p
fun t3() { p = Unit }
fun t4() { z() }
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !API_VERSION: 1.0
@SinceKotlin("1.1")
@@ -13,8 +13,8 @@ open class C2(val x: Int) {
typealias C2_Alias = C2
val test1 = C1_Alias()
val test2 = C2_Alias()
val test2 = C2_Alias(<!NO_VALUE_FOR_PARAMETER!>)<!>
class Test3 : C1_Alias()
class Test4 : C2_Alias()
class Test4 : <!NO_VALUE_FOR_PARAMETER!>C2_Alias<!>()
@@ -31,7 +31,7 @@ fun use1(
c1: NewClassExperimentalInThePast,
t1: TypeAliasToNewClass
) {
newPublishedFun()
<!UNRESOLVED_REFERENCE!>newPublishedFun<!>()
newFunExperimentalInThePast()
newValExperimentalInThePast
NewClassExperimentalInThePast()
@@ -42,7 +42,7 @@ fun use2(
c2: NewClassExperimentalInThePast,
t2: TypeAliasToNewClass
) {
newPublishedFun()
<!UNRESOLVED_REFERENCE!>newPublishedFun<!>()
newFunExperimentalInThePast()
newValExperimentalInThePast
NewClassExperimentalInThePast()
@@ -53,7 +53,7 @@ fun use3(
c3: NewClassExperimentalInThePast,
t3: TypeAliasToNewClass
) {
newPublishedFun()
<!UNRESOLVED_REFERENCE!>newPublishedFun<!>()
newFunExperimentalInThePast()
newValExperimentalInThePast
NewClassExperimentalInThePast()