[NI] Add constraint K <: T from constraint K <: CapturedType(in T)

#KT-33263 Fixed
This commit is contained in:
Dmitriy Novozhilov
2019-12-23 17:10:20 +03:00
parent b54169d312
commit 51424ec598
7 changed files with 104 additions and 4 deletions
@@ -0,0 +1,23 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER
// ISSUE: KT-33263
class A
class Foo<U>
class Bar<R>
fun <T> Foo<in T>.create(): Bar<in T> = null!!//Bar()
//fun <T> Foo<in T>.create(): Bar<T> = null!!//Bar()
fun <K> convert(bar: Bar<in K>): Bar<K> = null!!//Bar()
fun test(x: Any) {}
fun take(x: Bar<A>) {}
fun test_1(foo: Foo<A>) {
// convert(foo.create())
<!DEBUG_INFO_EXPRESSION_TYPE("Bar<A>")!>convert(foo.create())<!>
}
fun test_2(foo: Foo<A>) {
test(convert(foo.create()))
}