Java nullability checker: take type arguments' types from resolution atom if possible, instead of from resolved call directly

^KT-47833 Fixed
This commit is contained in:
Victor Petukhov
2021-07-27 16:07:00 +03:00
committed by teamcityserver
parent 93f9d9dacd
commit 7567597be6
6 changed files with 67 additions and 2 deletions
@@ -0,0 +1,30 @@
// FILE: main.kt
sealed class ClientBootResult
object ClientBootSuccess : ClientBootResult()
fun example(): Single<out ClientBootResult> {
return Single.just(true).map<ClientBootResult> { ClientBootSuccess }
}
// FILE: Single.java
import io.reactivex.rxjava3.annotations.NonNull;
public class Single<@NonNull T> {
@NonNull
public static <@NonNull T> Single<T> just(T item) {
return null;
}
@NonNull
public final <@NonNull R> Single<R> map(@NonNull Function<? super T, ? extends R> mapper) {
return null;
}
}
// FILE: Function.java
import io.reactivex.rxjava3.annotations.NonNull;
@FunctionalInterface
public interface Function<@NonNull T, @NonNull R> {
R apply(T t) throws Throwable;
}