[FIR] Consider variance of type parameters during java type enhancement
#KT-41940 Fixed
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
// ISSUE: KT-41940
|
||||
|
||||
// FILE: Matcher.java
|
||||
|
||||
public interface Matcher<T> {}
|
||||
|
||||
// FILE: Matchers.java
|
||||
|
||||
public class Matchers {
|
||||
public static <T> Matcher<java.lang.Iterable<? super T>> hasItem(T item) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static <T> void assertThat(T actual, Matcher<? super T> matcher) {}
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
import Matchers.*
|
||||
|
||||
fun test(list: List<String>, string: String) {
|
||||
assertThat(list, <!DEBUG_INFO_EXPRESSION_TYPE("Matcher<kotlin.collections.MutableIterable<*>..kotlin.collections.Iterable<*>?!>..Matcher<kotlin.collections.MutableIterable<*>..kotlin.collections.Iterable<*>?!>?!")!>hasItem(string)<!>)
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
FILE: main.kt
|
||||
public final fun test(list: R|kotlin/collections/List<kotlin/String>|, string: R|kotlin/String|): R|kotlin/Unit| {
|
||||
R|/Matchers.assertThat|<R|ft<kotlin/collections/List<kotlin/String>, kotlin/collections/List<kotlin/String>?>!|>(R|<local>/list|, R|/Matchers.hasItem|<R|ft<kotlin/String, kotlin/String?>!|>(R|<local>/string|))
|
||||
}
|
||||
Reference in New Issue
Block a user