[FE] Preserve legacy contract description calls in bodies
^KT-55231 Fixed ^KTIJ-21012 Fixed
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@ import kotlin.contracts.*
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun <T : Number?> T.case_1() {
|
||||
contract { returns() implies (this@case_1 is T) }
|
||||
contract { returns() implies (<!USELESS_IS_CHECK!>this@case_1 is T<!>) }
|
||||
if (!(<!USELESS_IS_CHECK!>this@case_1 is T<!>)) throw Exception()
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ fun case_11(value_1: Any?): Boolean? {
|
||||
|
||||
// TESTCASE NUMBER: 12
|
||||
fun Char.case_12() {
|
||||
contract { returns() implies (this@case_12 == null) }
|
||||
contract { returns() implies (<!SENSELESS_COMPARISON!>this@case_12 == null<!>) }
|
||||
if (<!SENSELESS_COMPARISON!>this@case_12 != null<!>) throw Exception()
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ class case_4 : ClassLevel3() {
|
||||
|
||||
fun <T>T.case_4_3_wrap() {
|
||||
fun case_4_3_contract() {
|
||||
contract { returns() implies (<!USELESS_IS_CHECK!>this@case_4_3_wrap is ClassLevel1<!>) }
|
||||
contract { returns() implies (this@case_4_3_wrap is ClassLevel1) }
|
||||
if (this@case_4_3_wrap !is ClassLevel1) throw Exception()
|
||||
}
|
||||
case_4_3_contract()
|
||||
|
||||
Reference in New Issue
Block a user