Deprecate simplification of complex boolean constant expressions in whens and loops

^KT-39883 In Progress
This commit is contained in:
Dmitriy Novozhilov
2021-06-25 11:40:51 +03:00
committed by teamcityserver
parent 8a2e0cedf9
commit 05883afc0a
36 changed files with 641 additions and 46 deletions
@@ -1,3 +1,4 @@
// LANGUAGE: -ProhibitSimplificationOfNonTrivialConstBooleanExpressions
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
fun t1() : Int{
@@ -68,12 +69,12 @@ fun t5() : Int {
return 1
<!UNREACHABLE_CODE!>2<!>
}
while (<!UNREACHABLE_CODE!>1 > 2<!>)
while (<!NON_TRIVIAL_BOOLEAN_CONSTANT, UNREACHABLE_CODE!>1 > 2<!>)
<!UNREACHABLE_CODE!>return 1<!>
}
fun t6() : Int {
while (1 > 2) {
while (<!NON_TRIVIAL_BOOLEAN_CONSTANT!>1 > 2<!>) {
return 1
<!UNREACHABLE_CODE!>2<!>
}
@@ -81,7 +82,7 @@ fun t6() : Int {
}
fun t6break() : Int {
while (1 > 2) {
while (<!NON_TRIVIAL_BOOLEAN_CONSTANT!>1 > 2<!>) {
break
<!UNREACHABLE_CODE!>2<!>
}