Fail calls constraints of which contain uninferred type parameter

^KT-44055 Fixed

It's possible only if there is a callable reference among subcalls which go though the old type inference (and the error for uninferred type parameter wasn't reported)
This commit is contained in:
Victor Petukhov
2020-12-24 13:52:05 +03:00
parent 9afc13f002
commit 0dde5ddd7e
8 changed files with 30 additions and 54 deletions
@@ -1,4 +1,5 @@
// WITH_RUNTIME
// IGNORE_BACKEND_FIR: JVM_IR
import kotlin.experimental.ExperimentalTypeInference
@@ -32,12 +32,6 @@ fun poll16(flag: Boolean): Any? {
return inv()
}
// TODO
//fun poll17(flag: Boolean): Any? {
// val inv = if (flag) { foo7() } else { ::Foo7 }
// return inv
//}
fun poll21(flag: Boolean): Any? {
val inv = when (flag) { true -> ::bar2 else -> ::foo2 }
return inv()
@@ -48,12 +42,6 @@ fun poll25(flag: Boolean): Any? {
return inv
}
// TODO
//fun poll26(flag: Boolean): Any? {
// val inv = when (flag) { true -> ::Foo7 false -> foo7() else -> ::Foo7 }
// return inv
//}
fun poll31(flag: Boolean): Any? {
val inv = when (flag) { true -> ::bar2 false -> ::foo2 }
return inv()
@@ -64,12 +52,6 @@ fun poll35(flag: Boolean): Any? {
return inv
}
// TODO
//fun poll36(flag: Boolean): Any? {
// val inv = when (flag) { true -> ::Foo7 false -> foo7() }
// return inv
//}
fun poll41(): Any? {
val inv = try { ::bar2 } finally { ::foo2 }
return inv()
@@ -90,12 +72,6 @@ fun poll55(): Any? {
return inv()
}
// TODO
//fun poll56(): Any? {
// val inv = try { ::Foo7 } catch (e: Exception) { foo7() } finally { foo7() }
// return inv
//}
fun poll61(): Any? {
val inv = ::bar2
return inv
@@ -121,7 +97,6 @@ fun poll81(): Any? {
return inv
}
fun poll85(): Any? {
val inv = ::Foo6 in setOf(::Foo6)
return inv
@@ -131,18 +106,14 @@ fun box(): String {
poll1(true)
poll11(true)
poll16(true)
// poll17(true)
poll21(true)
poll25(true)
// poll26(true)
poll31(true)
poll35(true)
// poll36(true)
poll41()
poll45()
poll51()
poll55()
// poll56()
poll61()
poll65()
poll71()