Deprecate simplification of complex boolean constant expressions in whens and loops
^KT-39883 In Progress
This commit is contained in:
committed by
teamcityserver
parent
8a2e0cedf9
commit
05883afc0a
@@ -1,3 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +ProhibitSimplificationOfNonTrivialConstBooleanExpressions
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
@@ -11,7 +13,7 @@
|
||||
// See also: KT-3743
|
||||
fun foo(arg: Boolean): String {
|
||||
// Must be exhaustive
|
||||
return when(arg) {
|
||||
return <!NO_ELSE_IN_WHEN!>when<!>(arg) {
|
||||
2 == 2 -> "truth"
|
||||
2 == 1 -> "falsehood"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user