[NI] Add constraint K <: T from constraint K <: CapturedType(in T)
#KT-33263 Fixed
This commit is contained in:
@@ -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())
|
||||
convert(foo.create())
|
||||
}
|
||||
|
||||
fun test_2(foo: Foo<A>) {
|
||||
test(convert(foo.create()))
|
||||
}
|
||||
@@ -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()))
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ K> convert(/*0*/ bar: Bar<in K>): Bar<K>
|
||||
public fun take(/*0*/ x: Bar<A>): kotlin.Unit
|
||||
public fun test(/*0*/ x: kotlin.Any): kotlin.Unit
|
||||
public fun test_1(/*0*/ foo: Foo<A>): kotlin.Unit
|
||||
public fun test_2(/*0*/ foo: Foo<A>): kotlin.Unit
|
||||
public fun </*0*/ T> Foo<in T>.create(): Bar<in T>
|
||||
|
||||
public final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class Bar</*0*/ R> {
|
||||
public constructor Bar</*0*/ R>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class Foo</*0*/ U> {
|
||||
public constructor Foo</*0*/ U>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user