FIR: accept when(nothing) {} as exhaustive

FE1.0 accepts this but FIR current rejects it.
This commit is contained in:
Tianyu Geng
2021-06-07 20:16:29 -07:00
committed by Ilya Kirillov
parent 26e3237b8c
commit 6ec247b861
12 changed files with 73 additions and 16 deletions
@@ -0,0 +1,9 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNREACHABLE_CODE
typealias MyNothing = Nothing
fun foo(n: Nothing, n2: MyNothing) {
val a: Unit = when(n) {}
val b: Unit = when(n2) {}
}
@@ -0,0 +1,4 @@
package
public fun foo(/*0*/ n: kotlin.Nothing, /*1*/ n2: MyNothing /* = kotlin.Nothing */): kotlin.Unit
public typealias MyNothing = kotlin.Nothing