[FE 1.0] Prohibit using non exhaustive if and when in rhs of elvis expression
^KT-44705 ^KT-49349 Fixed
This commit is contained in:
committed by
teamcityserver
parent
06a26a5a74
commit
a2b8493f47
@@ -56,8 +56,8 @@ fun g6(): Unit = <!TYPE_MISMATCH!><!NO_ELSE_IN_WHEN!>when<!> { true -> 42 }<!>
|
||||
fun foo1(x: String?) {
|
||||
"" + <!INVALID_IF_AS_EXPRESSION!>if<!> (true) 42
|
||||
w@while (true) {
|
||||
x ?: if (true) break
|
||||
x ?: when { true -> break@w }
|
||||
x ?: <!INVALID_IF_AS_EXPRESSION_WARNING!>if<!> (true) break
|
||||
x ?: <!NO_ELSE_IN_WHEN_WARNING!>when<!> { true -> break@w }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user