[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
@@ -21,7 +21,7 @@ fun test() {
checkSubtype<Int>(d)
val e = id(9223372036854775807)
e checkType { <!UNRESOLVED_REFERENCE!>_<!><Long>() }
e checkType { _<Long>() }
val f: Byte = either(1, 2)
@@ -32,7 +32,7 @@ fun test() {
<!INAPPLICABLE_CANDIDATE!>otherGeneric<!>(1)
val r = either(1, "")
r checkType { <!UNRESOLVED_REFERENCE!>_<!><Any>() }
r checkType { <!INAPPLICABLE_CANDIDATE!>_<!><Any>() }
use(a, b, c, d, e, f, g, r)
}
@@ -48,7 +48,7 @@ fun testExactBound(invS: Inv<String>, invI: Inv<Int>, invB: Inv<Byte>) {
exactBound(1, invI)
val b = exactBound(1, invB)
b checkType { <!UNRESOLVED_REFERENCE!>_<!><Byte>() }
b checkType { _<Byte>() }
}
interface Cov<out T>
@@ -57,10 +57,10 @@ fun <T> lowerBound(t: T, l : Cov<T>): T = throw Exception("$t $l")
fun testLowerBound(cov: Cov<String>, covN: Cov<Number>) {
val r = lowerBound(1, cov)
r checkType { <!UNRESOLVED_REFERENCE!>_<!><Any>() }
r checkType { <!INAPPLICABLE_CANDIDATE!>_<!><Any>() }
val n = lowerBound(1, covN)
n checkType { <!UNRESOLVED_REFERENCE!>_<!><Number>() }
n checkType { _<Number>() }
}
interface Contr<in T>
@@ -71,8 +71,8 @@ fun testUpperBound(contrS: Contr<String>, contrB: Contr<Byte>, contrN: Contr<Num
<!INAPPLICABLE_CANDIDATE!>upperBound<!>(1, contrS)
val n = upperBound(1, contrN)
n checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
n checkType { _<Int>() }
val b = upperBound(1, contrB)
b checkType { <!UNRESOLVED_REFERENCE!>_<!><Byte>() }
b checkType { _<Byte>() }
}