[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
@@ -1,12 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// !CHECK_TYPE
// KT-3372 Use upper bound in type argument inference
import java.util.HashSet
fun <T, C: MutableCollection<T>> Iterable<T>.toCollection(result: C) : C = throw Exception()
fun test(list: List<Int>) {
val set = list.toCollection(HashSet())
set checkType { <!UNRESOLVED_REFERENCE!>_<!><HashSet<Int>>() }
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
// !CHECK_TYPE
// KT-3372 Use upper bound in type argument inference
@@ -1,10 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// !CHECK_TYPE
fun <T, R> Collection<T>.map(transform : (T) -> R) : List<R> = throw Exception()
fun test(list: List<List<Int>>) {
val list1 = list.map { it.map { "$it" } }
list1 checkType { <!UNRESOLVED_REFERENCE!>_<!><List<List<String>>>() }
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
// !CHECK_TYPE
@@ -1,6 +0,0 @@
// !CHECK_TYPE
fun test() {
val array = arrayOf(arrayOf(1))
array checkType { <!UNRESOLVED_REFERENCE!>_<!><Array<Array<Int>>>() }
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !CHECK_TYPE
fun test() {