FIR: allow no else branch for when on Nothing(?)
This commit is contained in:
committed by
teamcityserver
parent
e242ad955b
commit
f737d8002e
@@ -0,0 +1,11 @@
|
||||
// !DIAGNOSTICS: -UNREACHABLE_CODE
|
||||
|
||||
// exhaustive
|
||||
fun test1(n: Nothing) = when (n) { }
|
||||
fun test2(n: Nothing?) = when (n) {
|
||||
null -> {}
|
||||
}
|
||||
|
||||
// not exhaustive
|
||||
fun test3(n: Nothing?) = <!NO_ELSE_IN_WHEN!>when<!> (n) {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// !DIAGNOSTICS: -UNREACHABLE_CODE
|
||||
|
||||
// exhaustive
|
||||
fun test1(n: Nothing) = when (n) { }
|
||||
fun test2(n: Nothing?) = <!NO_ELSE_IN_WHEN!>when<!> (<!DEBUG_INFO_CONSTANT!>n<!>) {
|
||||
null -> {}
|
||||
}
|
||||
|
||||
// not exhaustive
|
||||
fun test3(n: Nothing?) = <!NO_ELSE_IN_WHEN!>when<!> (<!DEBUG_INFO_CONSTANT!>n<!>) {
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package
|
||||
|
||||
public fun foo(/*0*/ n: kotlin.Nothing, /*1*/ nn: kotlin.Nothing?): kotlin.Unit
|
||||
Reference in New Issue
Block a user