FIR: Support exhaustive whens on subjects of intersection type

This commit is contained in:
Denis.Zharkov
2021-06-08 17:59:01 +03:00
parent c8b9a3a6f0
commit 2653565f56
11 changed files with 262 additions and 11 deletions
@@ -0,0 +1,21 @@
// SKIP_TXT
// FIR_IDENTICAL
// !CHECK_TYPE
sealed class KtClassifierSymbol
interface KtNamedSymbol
abstract class KtTypeParameterSymbol : KtClassifierSymbol() {}
sealed class KtClassLikeSymbol : KtClassifierSymbol() {}
fun foo(symbol: KtClassifierSymbol) {
if (symbol !is KtNamedSymbol) return
val x = when (symbol) {
is KtClassLikeSymbol -> "1"
is KtTypeParameterSymbol -> "2"
}
x checkType { _<String>() }
}