[FIR] Fix missing receiver type if anonymous function without label
This commit is contained in:
@@ -4,8 +4,8 @@ fun foo(s : String?, b : Boolean) {
|
||||
if (s == null) return
|
||||
|
||||
val s1 = if (b) "" else s
|
||||
s1 checkType { <!UNRESOLVED_REFERENCE!>_<!><String>() }
|
||||
s1 checkType { _<String>() }
|
||||
|
||||
val s2 = s
|
||||
s2 checkType { <!UNRESOLVED_REFERENCE!>_<!><String>() }
|
||||
s2 checkType { _<String>() }
|
||||
}
|
||||
@@ -8,8 +8,8 @@ fun case_0() {
|
||||
this as Int
|
||||
this // error in NI: required Int, found Any?; just inferred to Any? in OI
|
||||
}
|
||||
y checkType { <!UNRESOLVED_REFERENCE!>_<!><Any?>() }
|
||||
y checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
|
||||
y checkType { <!INAPPLICABLE_CANDIDATE!>_<!><Any?>() }
|
||||
y checkType { _<Int>() }
|
||||
}
|
||||
|
||||
fun case_1(z: Any?) {
|
||||
@@ -20,8 +20,8 @@ fun case_1(z: Any?) {
|
||||
else -> return@run ""
|
||||
}
|
||||
}
|
||||
y checkType { <!UNRESOLVED_REFERENCE!>_<!><Any?>() }
|
||||
y checkType { <!UNRESOLVED_REFERENCE!>_<!><kotlin.String>() }
|
||||
y checkType { <!INAPPLICABLE_CANDIDATE!>_<!><Any?>() }
|
||||
y checkType { _<kotlin.String>() }
|
||||
// y is inferred to Any?
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ fun case_2(z: Any?) {
|
||||
else -> return@run ""
|
||||
}
|
||||
}
|
||||
y checkType { <!UNRESOLVED_REFERENCE!>_<!><kotlin.String>() }
|
||||
y checkType { _<kotlin.String>() }
|
||||
// y is inferred to String
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ fun case_3(z: Any?) {
|
||||
else -> return@let ""
|
||||
}
|
||||
}
|
||||
y checkType { <!UNRESOLVED_REFERENCE!>_<!><Any?>() }
|
||||
y checkType { <!UNRESOLVED_REFERENCE!>_<!><kotlin.String>() }
|
||||
y checkType { <!INAPPLICABLE_CANDIDATE!>_<!><Any?>() }
|
||||
y checkType { _<kotlin.String>() }
|
||||
// y is inferred to String
|
||||
}
|
||||
Reference in New Issue
Block a user