[FIR] Fix missing receiver type if anonymous function without label

This commit is contained in:
simon.ogorodnik
2020-04-07 23:43:42 +03:00
parent d2fd377605
commit f573719cc1
143 changed files with 249 additions and 766 deletions
@@ -9,24 +9,24 @@ fun bar() {
b <!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String>() }
}
x checkType { <!UNRESOLVED_REFERENCE!>_<!><(A) -> Unit>() }
x checkType { _<(A) -> Unit>() }
val y = { (<!UNRESOLVED_REFERENCE!>a: Int<!>, <!UNRESOLVED_REFERENCE!>b<!>): A ->
a checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
a checkType { _<Int>() }
b <!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String>() }
}
y checkType { <!UNRESOLVED_REFERENCE!>_<!><(A) -> Unit>() }
y checkType { _<(A) -> Unit>() }
val y2 = { (<!UNRESOLVED_REFERENCE!>a: Number<!>, <!UNRESOLVED_REFERENCE!>b<!>): A ->
a checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
a checkType { <!INAPPLICABLE_CANDIDATE!>_<!><Int>() }
b <!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><String>() }
}
y2 checkType { <!UNRESOLVED_REFERENCE!>_<!><(A) -> Unit>() }
y2 checkType { _<(A) -> Unit>() }
val z = { (<!UNRESOLVED_REFERENCE!>a: Int<!>, <!UNRESOLVED_REFERENCE!>b: String<!>) ->
a checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
b checkType { <!UNRESOLVED_REFERENCE!>_<!><String>() }
a checkType { _<Int>() }
b checkType { _<String>() }
}
}
@@ -1,10 +0,0 @@
// !CHECK_TYPE
fun test() {
val a = if (true) {
val x = 1
({ x })
} else {
{ 2 }
}
a checkType { <!UNRESOLVED_REFERENCE!>_<!><() -> Int>() }
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !CHECK_TYPE
fun test() {
val a = if (true) {
@@ -1,7 +0,0 @@
// !CHECK_TYPE
fun <T> id(t: T) = t
fun foo() {
val i = id { 22 } //type inference error: no information for parameter
i checkType { <!UNRESOLVED_REFERENCE!>_<!><()->Int>() }
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !CHECK_TYPE
fun <T> id(t: T) = t