FIR IDE: add more tests about annotation resolution
This commit is contained in:
committed by
TeamCityServer
parent
e95313acbb
commit
464eecef03
+2
@@ -0,0 +1,2 @@
|
||||
<expr>@delegate:Suppress</expr>
|
||||
val annotatedDelegate by lazy { 1 + 1 }
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { }
|
||||
targetFunction = <constructor>(vararg names: kotlin.String): kotlin.Suppress
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
class A<T>(val value : T)
|
||||
class B<T>
|
||||
|
||||
fun <T> A<T>.toB(): B<T> {
|
||||
<expr>@Suppress("UNCHECKED_CAST")</expr>
|
||||
val v = (value as? Long)?.let { it.toInt() } as T ?: value
|
||||
return v
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { "UNCHECKED_CAST" -> (vararg names: kotlin.String) }
|
||||
targetFunction = <constructor>(vararg names: kotlin.String): kotlin.Suppress
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
fun foo(data: Any) {
|
||||
<expr>@Suppress("UNCHECKED_CAST")</expr>
|
||||
val (k, v) = data as Pair<String, String>
|
||||
}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
null
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
val a: Int = 42
|
||||
val b: Int = 24
|
||||
val c = <expr>@Suppress</expr> if (a > 2) a else b
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { }
|
||||
targetFunction = <constructor>(vararg names: kotlin.String): kotlin.Suppress
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
fun annotatedSwitch(str: String) =
|
||||
when {
|
||||
<expr>@Suppress("DEPRECATION")</expr>
|
||||
str.isBlank() -> null
|
||||
str.isNotEmpty() != null -> null
|
||||
else -> 1
|
||||
}
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { "DEPRECATION" -> (vararg names: kotlin.String) }
|
||||
targetFunction = <constructor>(vararg names: kotlin.String): kotlin.Suppress
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// WITH_STDLIB
|
||||
<expr>@file:JvmName("Foo")</expr>
|
||||
package some.pkg
|
||||
|
||||
val p : Int = 42
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { "Foo" -> (name: kotlin.String) }
|
||||
targetFunction = <constructor>(name: kotlin.String): kotlin.jvm.JvmName
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
annotation class Anno
|
||||
|
||||
class Test1(<expr>@param:Anno</expr> var bar: Int)
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { }
|
||||
targetFunction = <constructor>(): Anno
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
annotation class Anno
|
||||
|
||||
class Test1(<expr>@Anno</expr> var bar: Int)
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { }
|
||||
targetFunction = <constructor>(): Anno
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
inline fun <reified T> functionWithParamAnnotation(<expr>@Suppress("s")</expr> t: T): T = t
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { "s" -> (vararg names: kotlin.String) }
|
||||
targetFunction = <constructor>(vararg names: kotlin.String): kotlin.Suppress
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
annotation class Anno
|
||||
|
||||
class Test1(<expr>@setparam:Anno</expr> var bar: Int)
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { }
|
||||
targetFunction = <constructor>(): Anno
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
annotation class Anno
|
||||
|
||||
<expr>@field:Anno</expr>
|
||||
var p : Int = 42
|
||||
set(value) {
|
||||
if (value > field) {
|
||||
field = value
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { }
|
||||
targetFunction = <constructor>(): Anno
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
annotation class Anno
|
||||
|
||||
<expr>@get:Anno</expr>
|
||||
val p : Int = 42
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { }
|
||||
targetFunction = <constructor>(): Anno
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
annotation class Anno
|
||||
|
||||
<expr>@property:Anno</expr>
|
||||
val p : Int = 42
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { }
|
||||
targetFunction = <constructor>(): Anno
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
annotation class Anno
|
||||
|
||||
<expr>@set:Anno</expr>
|
||||
var p : Int = 42
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { }
|
||||
targetFunction = <constructor>(): Anno
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
annotation class Anno
|
||||
|
||||
<expr>@receiver:Anno</expr>
|
||||
fun String.foo() {
|
||||
return "$this (${this.length})"
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
KtAnnotationCall:
|
||||
argumentMapping = { }
|
||||
targetFunction = <constructor>(): Anno
|
||||
Reference in New Issue
Block a user