[NI] Fix extracting type variables for flexible types in in captured types
Bug was introduced in b99efb because of lack of tests. All code in `AbstractTypeCheckerContextForConstraintSystem.extractTypeVariableForSubtype` related to IN projection looks suspicious and needs further investigation
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
// FILE: A.java
|
||||
|
||||
public class A<T> {
|
||||
public A<? super T> getSuperA() { return null; }
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
fun <T : Any> foo(x: T?, func: (T) -> T?) {}
|
||||
|
||||
fun test(a: A<*>) {
|
||||
foo(a) { it.superA }
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ T : kotlin.Any> foo(/*0*/ x: T?, /*1*/ func: (T) -> T?): kotlin.Unit
|
||||
public fun test(/*0*/ a: A<*>): kotlin.Unit
|
||||
|
||||
public open class A</*0*/ T : kotlin.Any!> {
|
||||
public constructor A</*0*/ T : kotlin.Any!>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open fun getSuperA(): A<in T!>!
|
||||
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