[NI-TESTS] Add regression tests
^KT-33638 Obsolete Add test for case mentioned in KT-33629. Used to be runtime failure instead of error diagnostic.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// WITH_RUNTIME
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
class Holder(val list: List<String>?)
|
||||
|
||||
fun box(): String {
|
||||
val holder1 = Holder(emptyList()) // No problem
|
||||
val holder2 = Holder(if(true) emptyList<String>() else null) // No problem
|
||||
val holder3 = Holder(if(true) emptyList() else mutableListOf()) // No problem
|
||||
val holder4 = Holder(if(true) emptyList() else null) // Compile error
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user