Files
kotlin-fork/nj2k/testData/inference/nullability/loops.kt
T
Ilya Kirillov f61bb5aa39 New J2K: implement mutability inference in post-processing
#KT-24293 fixed
#KT-19603 fixed
2019-09-10 14:09:26 +03:00

32 lines
1.2 KiB
Kotlin
Vendored

fun bar(map: /*T2@*/HashMap</*T0@*/String?, /*T1@*/Int>, list1: /*T4@*/List</*T3@*/Int>, list2: /*T6@*/List</*T5@*/String?>) {
for (entry: /*T9@*/MutableMap.MutableEntry</*T7@*/String?, /*T8@*/Int> in map/*T2@HashMap<T0@String, T1@Int>*/.entries/*MutableSet<MutableEntry<T0@String, T1@Int>>*/) {
val value: /*T10@*/Int = entry/*T9@MutableEntry<T7@String, T8@Int>*/.value/*T8@Int*/
if (entry/*T9@MutableEntry<T7@String, T8@Int>*/.key/*T7@String*/ == null/*LIT*/) {
println(value/*T10@Int*/ + 1/*LIT*//*LIT*/)
}
}
for (i: /*T11@*/Int in list1/*T4@List<T3@Int>*/) {
i/*T11@Int*/ + 1/*LIT*/
}
for (i: /*T12@*/String? in list2/*T6@List<T5@String>*/) {
i/*T12@String*/ == null
}
}
//T2 := LOWER due to 'USE_AS_RECEIVER'
//T9 := LOWER due to 'USE_AS_RECEIVER'
//T8 <: T10 due to 'INITIALIZER'
//T9 := LOWER due to 'USE_AS_RECEIVER'
//T7 := UPPER due to 'COMPARE_WITH_NULL'
//T10 := LOWER due to 'USE_AS_RECEIVER'
//T7 := T0 due to 'ASSIGNMENT'
//T8 := T1 due to 'ASSIGNMENT'
//T11 := LOWER due to 'USE_AS_RECEIVER'
//T3 <: T11 due to 'ASSIGNMENT'
//T4 := LOWER due to 'USE_AS_RECEIVER'
//T12 := UPPER due to 'COMPARE_WITH_NULL'
//T5 <: T12 due to 'ASSIGNMENT'
//T6 := LOWER due to 'USE_AS_RECEIVER'