[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:
Dmitriy Novozhilov
2019-08-01 10:54:11 +03:00
parent 71a1a0e2f5
commit b6a7d21579
6 changed files with 44 additions and 1 deletions
@@ -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 }
}
@@ -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
}