[FE] Properly support sealed interfaces in exhaustiveness checker

#KT-20423
This commit is contained in:
Dmitriy Novozhilov
2020-11-17 10:59:30 +03:00
committed by TeamCityServer
parent 9609954560
commit 8e9e34350f
3 changed files with 21 additions and 52 deletions
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// ISSUE: KT-20423
// !LANGUAGE: +FreedomForSealedClasses +SealedInterfaces
// !DIAGNOSTICS: -UNUSED_VARIABLE
@@ -27,7 +28,7 @@ fun test_1(base: Base) {
}
fun test_2(base: Base) {
val x = <!NO_ELSE_IN_WHEN!>when<!> (base) {
val x = when (base) {
is A -> 1
is B.First -> 2
is B.Second -> 3