[CFA] Mark arguments of all annotation calls as USED_AS_EXPRESSION
Also revert hacky fix of KT-37294 introduced in 80caa063b
#KT-37447 Fixed
This commit is contained in:
+48
@@ -0,0 +1,48 @@
|
||||
== Test_1 ==
|
||||
class Test_1 {
|
||||
@Target(AnnotationTarget.VALUE_PARAMETER)
|
||||
annotation class Range(val min: Long = 0)
|
||||
|
||||
fun foo(@Range(min = -90L) x: Int) = Unit // KtPrefixExpression isn't marked as BindingContext.USED_AS_EXPRESSION
|
||||
}
|
||||
---------------------
|
||||
=====================
|
||||
== foo ==
|
||||
fun foo(@Range(min = -90L) x: Int) = Unit // KtPrefixExpression isn't marked as BindingContext.USED_AS_EXPRESSION
|
||||
---------------------
|
||||
<v0>: Int NEW: magic[FAKE_INITIALIZER](@Range(min = -90L) x: Int) -> <v0>
|
||||
Unit <v1>: Unit NEW: r(Unit) -> <v1>
|
||||
=====================
|
||||
== Test_2 ==
|
||||
class Test_2 {
|
||||
@Target(AnnotationTarget.FUNCTION)
|
||||
annotation class Range(val min: Long = 0)
|
||||
|
||||
@Range(min = -90L) // KtPrefixExpression is marked as BindingContext.USED_AS_EXPRESSION
|
||||
fun foo(x: Int) = Unit
|
||||
}
|
||||
---------------------
|
||||
=====================
|
||||
== foo ==
|
||||
@Range(min = -90L) // KtPrefixExpression is marked as BindingContext.USED_AS_EXPRESSION
|
||||
fun foo(x: Int) = Unit
|
||||
---------------------
|
||||
<v0>: Int NEW: magic[FAKE_INITIALIZER](x: Int) -> <v0>
|
||||
Unit <v1>: Unit NEW: r(Unit) -> <v1>
|
||||
=====================
|
||||
== Test_3 ==
|
||||
class Test_3 {
|
||||
@Target(AnnotationTarget.EXPRESSION)
|
||||
annotation class Range(val min: Long = 0)
|
||||
|
||||
fun foo(x: Int) = @Range(min = -90L) Unit
|
||||
}
|
||||
---------------------
|
||||
=====================
|
||||
== foo ==
|
||||
fun foo(x: Int) = @Range(min = -90L) Unit
|
||||
---------------------
|
||||
<v0>: Int NEW: magic[FAKE_INITIALIZER](x: Int) -> <v0>
|
||||
Unit <v1>: Unit NEW: r(Unit) -> <v1>
|
||||
@Range(min = -90L) Unit <v1>: Unit COPY
|
||||
=====================
|
||||
Reference in New Issue
Block a user