[FIR] Transform annotations of type refs in body resolve stage

Also fix building CFG for annotation calls
This commit is contained in:
Dmitriy Novozhilov
2021-04-12 18:51:15 +03:00
committed by TeamCityServer
parent aec13defc4
commit 1f0ecade34
25 changed files with 96 additions and 45 deletions
@@ -4,10 +4,10 @@
@Target(AnnotationTarget.TYPE)
annotation class Anno(val value: String)
fun foo(x: String): @Anno(Lorem, ipsum::class, "dolor", sit-amet) String { // OK
fun foo(x: String): @Anno(<!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>Lorem<!>, <!TOO_MANY_ARGUMENTS, TOO_MANY_ARGUMENTS!><!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>ipsum<!>::class<!>, <!TOO_MANY_ARGUMENTS, TOO_MANY_ARGUMENTS!>"dolor"<!>, <!TOO_MANY_ARGUMENTS, TOO_MANY_ARGUMENTS!><!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>sit<!>-<!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>amet<!><!>) String { // OK
return x
}
abstract class Foo : @Anno(o_O) Throwable() // OK
abstract class Foo : @Anno(<!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>o_O<!>) Throwable() // OK
abstract class Bar<T : @Anno(O_o) Any> // OK
abstract class Bar<T : @Anno(<!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>O_o<!>) Any> // OK
@@ -6,7 +6,7 @@ interface B : A
interface C : A
@Suppress("INVISIBLE_REFERENCE")
fun <K> select(x: K, y: K): @kotlin.internal.Exact K = x
fun <K> select(x: K, y: K): <!HIDDEN, HIDDEN!>@kotlin.internal.Exact<!> K = x
fun foo(a: Any) {}
@@ -6,7 +6,7 @@ interface B : A
interface C : A
@Suppress("INVISIBLE_REFERENCE")
fun <K> select(x: K, y: K): @kotlin.internal.Exact K = x
fun <K> select(x: K, y: K): <!HIDDEN, HIDDEN!>@kotlin.internal.Exact<!> K = x
fun foo(a: Any) {}
@@ -6,7 +6,7 @@ interface ISample
fun <K> elvisSimple(x: K?, y: K): K = y
@Suppress("INVISIBLE_REFERENCE")
fun <K> elvisExact(x: K?, y: K): @kotlin.internal.Exact K = y
fun <K> elvisExact(x: K?, y: K): <!HIDDEN, HIDDEN!>@kotlin.internal.Exact<!> K = y
fun <T : Number> materialize(): T? = TODO()
@@ -6,7 +6,7 @@ interface ISample
fun <K> elvisSimple(x: K?, y: K): K = y
@Suppress("INVISIBLE_REFERENCE")
fun <K> elvisExact(x: K?, y: K): @kotlin.internal.Exact K = y
fun <K> elvisExact(x: K?, y: K): <!HIDDEN, HIDDEN!>@kotlin.internal.Exact<!> K = y
fun <T : Number> materialize(): T? = null
fun <T> Any?.materialize(): T = null as T
@@ -6,7 +6,7 @@
import kotlin.internal.Exact
class Inv<I>(val arg: I)
class InvExact<E>(val arg: @kotlin.internal.Exact E)
class InvExact<E>(val arg: <!HIDDEN, HIDDEN!>@kotlin.internal.Exact<!> E)
interface Base
class Derived : Base