Change parsing of statements starting with annotations
If a block statement starts with annotations treat them as they belong to node of the statement rather than to the closest prefix expression #KT-10210 Fixed
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
fun <T : CharSequence> foo(x: Array<Any>, y: IntArray, block: (T, Int) -> Int) {
|
||||
var r: Any?
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
r = block(x[0] as T, "" <!CAST_NEVER_SUCCEEDS!>as<!> Int)
|
||||
|
||||
// to prevent unused assignment diagnostic for the above statement
|
||||
<!DEBUG_INFO_SMARTCAST!>r<!>.hashCode()
|
||||
|
||||
var i = 1
|
||||
|
||||
if (i != 1) {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
i += block(x[0] as T, "" <!CAST_NEVER_SUCCEEDS!>as<!> Int).toInt()
|
||||
}
|
||||
|
||||
val l: () -> Unit = {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
i += block(x[0] as T, "" <!CAST_NEVER_SUCCEEDS!>as<!> Int).toInt()
|
||||
}
|
||||
l()
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
y[i] += block(x[0] as T, "" <!CAST_NEVER_SUCCEEDS!>as<!> Int).toInt()
|
||||
}
|
||||
Reference in New Issue
Block a user