Files
kotlin-fork/compiler/testData/codegen/box/regressions/kt33638.kt
T
Dmitriy Novozhilov 5f9f01fe4e [FIR] Implement new completion mode calculator
Note that `testDelegates` now fails due to KT-37638 and
    `testSimpleIn` fails due to problems with type parameters
    of inner classes
2020-03-20 23:11:28 +03:00

14 lines
434 B
Kotlin
Vendored

// !LANGUAGE: +NewInference
// WITH_RUNTIME
// KJS_WITH_FULL_RUNTIME
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"
}