[NI] fix approximation of not denotable types in lambda's function descriptors

This commit is contained in:
Dmitriy Novozhilov
2019-03-26 13:48:44 +03:00
parent a9de157fd4
commit 4a1b9dcc3c
5 changed files with 40 additions and 1 deletions
@@ -0,0 +1,18 @@
// !LANGUAGE: +NewInference
// TARGET_BACKEND: JVM
// WITH_RUNTIME
class Foo<C : Any> {
fun test(candidates: Collection<C>): List<C> {
return candidates.sortedBy { 1 }
}
}
fun box(): String {
val foo = Foo<String>()
val list = listOf("OK")
val sorted = foo.test(list)
return list.first()
}