[FE 1.0] Prohibit confusing syntax inside when branches

^KT-48385 Fixed
This commit is contained in:
Dmitriy Novozhilov
2021-10-20 16:40:13 +03:00
committed by teamcityserver
parent 653fc85461
commit 1513e739c6
28 changed files with 1323 additions and 28 deletions
@@ -14,7 +14,7 @@
fun foo(arg: Boolean): String {
// Must be exhaustive
return <!NO_ELSE_IN_WHEN!>when<!>(arg) {
2 == 2 -> "truth"
2 == 1 -> "falsehood"
(2 == 2) -> "truth"
(2 == 1) -> "falsehood"
}
}