[FE 1.0] Check for type mismatch for empty when statements
^KT-47922 Fixed
This commit is contained in:
committed by
TeamCityServer
parent
60195114c1
commit
8578f0beea
@@ -0,0 +1,11 @@
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
sealed class Sealed {
|
||||
|
||||
}
|
||||
|
||||
fun foo(s: Sealed): Int {
|
||||
return <!NO_ELSE_IN_WHEN!>when<!>(s) {
|
||||
// We do not return anything, so else branch must be here
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
sealed class Sealed {
|
||||
|
||||
}
|
||||
|
||||
fun foo(s: Sealed): Int {
|
||||
return <!NO_ELSE_IN_WHEN!>when<!>(s) {
|
||||
return <!TYPE_MISMATCH!><!NO_ELSE_IN_WHEN!>when<!>(s) {
|
||||
// We do not return anything, so else branch must be here
|
||||
}
|
||||
}<!>
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user