cff88a3f8b
Note, that this change potentially has some other effects in corner cases (like the changed test data that is rather sensible because `bar` in the example is not effectively projected out and can be called with nulls) Probably, we need to consider rewriting all other isSomeType methods in KotlinBuiltins, but now it seems to be a rather dangerous change #KT-16424 Fixed
18 lines
379 B
Kotlin
Vendored
18 lines
379 B
Kotlin
Vendored
// FILE: TestClass.java
|
|
import org.jetbrains.annotations.Nullable;
|
|
public class TestClass {
|
|
public <T> T set(@Nullable String key, @Nullable T t) {
|
|
return t;
|
|
}
|
|
}
|
|
|
|
// FILE: main.kt
|
|
fun run() {
|
|
val testClass = TestClass()
|
|
// inferred as `set<Nothing>()`, return type is Nothing!
|
|
testClass.set("test", null)
|
|
|
|
// Should not be unreachable
|
|
run()
|
|
}
|