[NI] Fix CST calculation for covariant type projections

This commit is contained in:
Mikhail Zarechenskiy
2020-01-16 13:34:34 +03:00
parent 082cbae74a
commit 4f74515508
6 changed files with 48 additions and 2 deletions
@@ -0,0 +1,20 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
// FILE: Foo.java
public class Foo {
public static <K, V> void create(java.util.Map<? extends K, ? extends V> m) { return null; }
}
// FILE: test.kt
fun test(properties: Map<String, String>, nullableProperties: Map<String, String>?) {
val f1 = Foo.create(select1(properties, myEmptyMap()))
val f2 = Foo.create(nullableProperties ?: myEmptyMap())
}
fun <T, R> myEmptyMap(): Map<T, R> = TODO()
@Suppress("INVISIBLE_REFERENCE")
fun <S> select1(x: S, y: S): @kotlin.internal.Exact S = y
@@ -0,0 +1,15 @@
package
public fun </*0*/ T, /*1*/ R> myEmptyMap(): kotlin.collections.Map<T, R>
@kotlin.Suppress(names = {"INVISIBLE_REFERENCE"}) public fun </*0*/ S> select1(/*0*/ x: S, /*1*/ y: S): S
public fun test(/*0*/ properties: kotlin.collections.Map<kotlin.String, kotlin.String>, /*1*/ nullableProperties: kotlin.collections.Map<kotlin.String, kotlin.String>?): kotlin.Unit
public open class Foo {
public constructor Foo()
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
// Static members
public open fun </*0*/ K : kotlin.Any!, /*1*/ V : kotlin.Any!> create(/*0*/ m: (kotlin.collections.MutableMap<out K!, out V!>..kotlin.collections.Map<out K!, V!>?)): kotlin.Unit
}