[NI] Eliminate special intersection type from result type
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
// WITH_RUNTIME
|
||||
// IGNORE_BACKEND: JS, NATIVE
|
||||
|
||||
// FILE: First.java
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Iterator;
|
||||
|
||||
public class First {
|
||||
public static <A> List<A> from(List<A> var0) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: second.kt
|
||||
|
||||
fun <T> List<T>.listFromJava() = First.from(this)
|
||||
fun <T> List<T>.listFromKotlin() = fromKotlin(this)
|
||||
|
||||
fun <T> fromKotlin(var0: List<T?>): List<T?> = var0
|
||||
|
||||
fun test(a: List<Int>) {
|
||||
val b: List<Int>? = a.listFromJava()
|
||||
val c: List<Int?> = a.listFromKotlin()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
test(listOf(1))
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
// IGNORE_BACKEND: JS, NATIVE
|
||||
|
||||
// FILE: First.java
|
||||
|
||||
public class First<T> {
|
||||
public static <K> First<K> first(K key) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: second.kt
|
||||
|
||||
class Inv<T>(val key: T)
|
||||
|
||||
fun <T, R> lastLambda(x: T, block: (T) -> R): R = block(x)
|
||||
|
||||
fun <S> myTest(m: Inv<S>) {
|
||||
lastLambda(m) { First.first(it.key) }
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user