Make freshly substituted type variables def not nullable if they come from not null type parameter

^KT-48778 Fixed
This commit is contained in:
Victor Petukhov
2021-10-06 18:42:35 +03:00
parent 02d06b6390
commit 836c6b280d
12 changed files with 80 additions and 14 deletions
@@ -3,7 +3,7 @@ import java.util.*
fun use() {
val x: String? = "x"
Optional.of(x)
// UNSAFE_CALL_ERROR
// SUCCESS
// ORIGINAL: fun <T : Any!> of(T): Optional<T> defined in java.util.Optional
// SUBSTITUTED: fun <T : Any!> of(String): Optional<String> defined in java.util.Optional