Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/elvisOnJavaList.fir.kt
T
Denis.Zharkov 9fa0f51a61 K2: Fix false-negative RETURN_TYPE_MISMATCH
^KT-53987 Fixed
^KT-55932 Fixed
2023-02-15 08:13:42 +00:00

19 lines
420 B
Kotlin
Vendored

// FILE: P.java
import java.util.ArrayList;
import java.util.List;
public class P {
public List<Integer> getList() {
return new ArrayList<Integer>();
}
}
// FILE: Test.kt
fun foo(c: P): MutableList<Int> {
// Error should be here: see KT-8168 Typechecker fails for platform collection type
return <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>c.getList() ?: <!TYPE_MISMATCH!>listOf()<!><!>
}