[FIR] Transform annotations of type refs in body resolve stage
Also fix building CFG for annotation calls
This commit is contained in:
committed by
TeamCityServer
parent
aec13defc4
commit
1f0ecade34
+30
@@ -0,0 +1,30 @@
|
||||
//!DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
fun <R> Iterable<*>.filterIsInstance1(): List<@kotlin.internal.NoInfer R> = throw Exception()
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
fun <R> List<*>.filterIsInstance2(): <!HIDDEN, HIDDEN!>@kotlin.internal.NoInfer<!> List<R> = throw Exception()
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.filterIsInstance1<Int>().map { it * 2 }
|
||||
list.filterIsInstance2<Int>().filter { it > 10 }
|
||||
}
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
fun <R> foo(t: R): List<@kotlin.internal.NoInfer R> = throw Exception("$t")
|
||||
|
||||
fun test() {
|
||||
foo(1).map { it * 2 }
|
||||
}
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
fun <R> List<R>.foo(): <!HIDDEN, HIDDEN!>@kotlin.internal.NoInfer<!> R = throw Exception()
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
fun <R> bar(r: R, f: Function1<@kotlin.internal.NoInfer R, Unit>): Nothing = throw Exception()
|
||||
|
||||
fun test1() {
|
||||
listOf("").foo().length
|
||||
bar(1) { x -> x + 1 }
|
||||
}
|
||||
+1
-2
@@ -1,4 +1,3 @@
|
||||
// FIR_IDENTICAL
|
||||
//!DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
@@ -28,4 +27,4 @@ fun <R> bar(r: R, f: Function1<@kotlin.internal.NoInfer R, Unit>): Nothing = thr
|
||||
fun test1() {
|
||||
listOf("").foo().length
|
||||
bar(1) { x -> x + 1 }
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
public fun <T> Iterable<T>.contains1(element: T): Int<!> = null!!
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
public fun <T> Iterable<T>.contains1(element: @kotlin.internal.NoInfer T): Boolean<!> = null!!
|
||||
public fun <T> Iterable<T>.contains1(element: <!HIDDEN, HIDDEN!>@kotlin.internal.NoInfer<!> T): Boolean<!> = null!!
|
||||
|
||||
|
||||
fun test() {
|
||||
|
||||
+5
-5
@@ -2,13 +2,13 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
fun <T> test1(t1: T, t2: @kotlin.internal.NoInfer T): T = t1
|
||||
fun <T> test1(t1: T, t2: <!HIDDEN, HIDDEN!>@kotlin.internal.NoInfer<!> T): T = t1
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
fun <T> @kotlin.internal.NoInfer T.test2(t1: T): T = t1
|
||||
fun <T> <!HIDDEN, HIDDEN!>@kotlin.internal.NoInfer<!> T.test2(t1: T): T = t1
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
fun <T> test3(t1: @kotlin.internal.NoInfer T): T = t1
|
||||
fun <T> test3(t1: <!HIDDEN, HIDDEN!>@kotlin.internal.NoInfer<!> T): T = t1
|
||||
|
||||
fun usage() {
|
||||
test1(1, "312")
|
||||
@@ -17,7 +17,7 @@ fun usage() {
|
||||
}
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
fun <T> List<T>.contains1(e: @kotlin.internal.NoInfer T): Boolean = true
|
||||
fun <T> List<T>.contains1(e: <!HIDDEN, HIDDEN!>@kotlin.internal.NoInfer<!> T): Boolean = true
|
||||
|
||||
fun test(i: Int?, a: Any, l: List<Int>) {
|
||||
l.contains1(a)
|
||||
@@ -26,7 +26,7 @@ fun test(i: Int?, a: Any, l: List<Int>) {
|
||||
}
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
fun <T> assertEquals1(e1: T, e2: @kotlin.internal.NoInfer T): Boolean = true
|
||||
fun <T> assertEquals1(e1: T, e2: <!HIDDEN, HIDDEN!>@kotlin.internal.NoInfer<!> T): Boolean = true
|
||||
|
||||
fun test(s: String) {
|
||||
assertEquals1(s, 11)
|
||||
|
||||
+3
-3
@@ -2,7 +2,7 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
private object TopLevelTypeVariable {
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "HIDDEN")
|
||||
fun <T> foo(): @kotlin.internal.NoInfer T = TODO()
|
||||
|
||||
fun <K> bar(k: K) {}
|
||||
@@ -15,7 +15,7 @@ private object TopLevelTypeVariable {
|
||||
private object NestedTypeVariable {
|
||||
class Inv<T>
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "HIDDEN")
|
||||
fun <T> foo(): Inv<@kotlin.internal.NoInfer T> = TODO()
|
||||
|
||||
fun <K> bar(p: Inv<K>) {}
|
||||
@@ -23,4 +23,4 @@ private object NestedTypeVariable {
|
||||
fun test() {
|
||||
bar(foo<String>())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ private object NestedTypeVariable {
|
||||
private constructor NestedTypeVariable()
|
||||
public final fun </*0*/ K> bar(/*0*/ p: NestedTypeVariable.Inv<K>): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
@kotlin.Suppress(names = {"INVISIBLE_MEMBER", "INVISIBLE_REFERENCE"}) public final fun </*0*/ T> foo(): NestedTypeVariable.Inv<T>
|
||||
@kotlin.Suppress(names = {"INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "HIDDEN"}) public final fun </*0*/ T> foo(): NestedTypeVariable.Inv<T>
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final fun test(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
@@ -21,7 +21,7 @@ private object TopLevelTypeVariable {
|
||||
private constructor TopLevelTypeVariable()
|
||||
public final fun </*0*/ K> bar(/*0*/ k: K): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
@kotlin.Suppress(names = {"INVISIBLE_MEMBER", "INVISIBLE_REFERENCE"}) public final fun </*0*/ T> foo(): T
|
||||
@kotlin.Suppress(names = {"INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "HIDDEN"}) public final fun </*0*/ T> foo(): T
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final fun test(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
Reference in New Issue
Block a user