[FE] Preserve legacy contract description calls in bodies
^KT-55231 Fixed ^KTIJ-21012 Fixed
This commit is contained in:
Vendored
+6
-6
@@ -156,29 +156,29 @@ fun <T> T?.case_22_3(): Boolean? {
|
||||
|
||||
// TESTCASE NUMBER: 23
|
||||
fun <T : Number?> T.case_23_1(): Boolean {
|
||||
contract { returns(false) implies (this@case_23_1 !is Int || this@case_23_1 == null) }
|
||||
contract { returns(false) implies (this@case_23_1 !is Int || <!SENSELESS_COMPARISON!>this@case_23_1 == null<!>) }
|
||||
return !(this@case_23_1 !is Int || <!SENSELESS_COMPARISON!>this@case_23_1 == null<!>)
|
||||
}
|
||||
fun <T : Number?> T.case_23_2(): Boolean? {
|
||||
contract { returnsNotNull() implies (this@case_23_2 !is Int || this@case_23_2 == null) }
|
||||
contract { returnsNotNull() implies (this@case_23_2 !is Int || <!SENSELESS_COMPARISON!>this@case_23_2 == null<!>) }
|
||||
return if (this@case_23_2 !is Int || <!SENSELESS_COMPARISON!>this@case_23_2 == null<!>) true else null
|
||||
}
|
||||
fun <T : Number?> T.case_23_3(): Boolean? {
|
||||
contract { returns(null) implies (this@case_23_3 !is Int || this@case_23_3 == null) }
|
||||
contract { returns(null) implies (this@case_23_3 !is Int || <!SENSELESS_COMPARISON!>this@case_23_3 == null<!>) }
|
||||
return if (this@case_23_3 !is Int || <!SENSELESS_COMPARISON!>this@case_23_3 == null<!>) null else true
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 24
|
||||
inline fun <reified T : Any?> T?.case_24_1(): Boolean {
|
||||
contract { returns(false) implies (this@case_24_1 !is Number || this@case_24_1 !is Int || this@case_24_1 == null) }
|
||||
contract { returns(false) implies (this@case_24_1 !is Number || this@case_24_1 !is Int || <!SENSELESS_COMPARISON!>this@case_24_1 == null<!>) }
|
||||
return !(this@case_24_1 !is Number || this@case_24_1 !is Int || <!SENSELESS_COMPARISON!>this@case_24_1 == null<!>)
|
||||
}
|
||||
inline fun <reified T : Any?> T?.case_24_2(): Boolean? {
|
||||
contract { returnsNotNull() implies (this@case_24_2 !is Number || this@case_24_2 !is Int || this@case_24_2 == null) }
|
||||
contract { returnsNotNull() implies (this@case_24_2 !is Number || this@case_24_2 !is Int || <!SENSELESS_COMPARISON!>this@case_24_2 == null<!>) }
|
||||
return if (this@case_24_2 !is Number || this@case_24_2 !is Int || <!SENSELESS_COMPARISON!>this@case_24_2 == null<!>) true else null
|
||||
}
|
||||
inline fun <reified T : Any?> T?.case_24_3(): Boolean? {
|
||||
contract { returns(null) implies (this@case_24_3 !is Number || this@case_24_3 !is Int || this@case_24_3 == null) }
|
||||
contract { returns(null) implies (this@case_24_3 !is Number || this@case_24_3 !is Int || <!SENSELESS_COMPARISON!>this@case_24_3 == null<!>) }
|
||||
return if (this@case_24_3 !is Number || this@case_24_3 !is Int || <!SENSELESS_COMPARISON!>this@case_24_3 == null<!>) null else true
|
||||
}
|
||||
|
||||
|
||||
Vendored
+10
-10
@@ -14,13 +14,13 @@ fun <T> T?.case_1() {
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
fun <T : Number?> T.case_2() {
|
||||
contract { returns() implies (this@case_2 !is Int || this@case_2 == null) }
|
||||
contract { returns() implies (this@case_2 !is Int || <!SENSELESS_COMPARISON!>this@case_2 == null<!>) }
|
||||
if (!(this@case_2 !is Int || <!SENSELESS_COMPARISON!>this@case_2 == null<!>)) throw Exception()
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
inline fun <reified T : Any?> T?.case_3() {
|
||||
contract { returns() implies (this@case_3 !is Number || this@case_3 !is Int || this@case_3 == null) }
|
||||
contract { returns() implies (this@case_3 !is Number || this@case_3 !is Int || <!SENSELESS_COMPARISON!>this@case_3 == null<!>) }
|
||||
if (!(this@case_3 !is Number || this@case_3 !is Int || <!SENSELESS_COMPARISON!>this@case_3 == null<!>)) throw Exception()
|
||||
}
|
||||
|
||||
@@ -44,37 +44,37 @@ fun <T> T?.case_4_4(): Boolean? {
|
||||
|
||||
// TESTCASE NUMBER: 5
|
||||
fun <T : Number?> T.case_5_1(): Boolean {
|
||||
contract { returns(true) implies (this@case_5_1 !is Int || this@case_5_1 == null) }
|
||||
contract { returns(true) implies (this@case_5_1 !is Int || <!SENSELESS_COMPARISON!>this@case_5_1 == null<!>) }
|
||||
return this@case_5_1 !is Int || <!SENSELESS_COMPARISON!>this@case_5_1 == null<!>
|
||||
}
|
||||
fun <T : Number?> T.case_5_2(): Boolean {
|
||||
contract { returns(false) implies (this@case_5_2 !is Int || this@case_5_2 == null) }
|
||||
contract { returns(false) implies (this@case_5_2 !is Int || <!SENSELESS_COMPARISON!>this@case_5_2 == null<!>) }
|
||||
return !(this@case_5_2 !is Int || <!SENSELESS_COMPARISON!>this@case_5_2 == null<!>)
|
||||
}
|
||||
fun <T : Number?> T.case_5_3(): Boolean? {
|
||||
contract { returnsNotNull() implies (this@case_5_3 !is Int || this@case_5_3 == null) }
|
||||
contract { returnsNotNull() implies (this@case_5_3 !is Int || <!SENSELESS_COMPARISON!>this@case_5_3 == null<!>) }
|
||||
return if (this@case_5_3 !is Int || <!SENSELESS_COMPARISON!>this@case_5_3 == null<!>) true else null
|
||||
}
|
||||
fun <T : Number?> T.case_5_4(): Boolean? {
|
||||
contract { returns(null) implies (this@case_5_4 !is Int || this@case_5_4 == null) }
|
||||
contract { returns(null) implies (this@case_5_4 !is Int || <!SENSELESS_COMPARISON!>this@case_5_4 == null<!>) }
|
||||
return if (this@case_5_4 !is Int || <!SENSELESS_COMPARISON!>this@case_5_4 == null<!>) null else true
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 6
|
||||
inline fun <reified T : Any?> T?.case_6_1(): Boolean {
|
||||
contract { returns(true) implies (this@case_6_1 !is Number || this@case_6_1 !is Int || this@case_6_1 == null) }
|
||||
contract { returns(true) implies (this@case_6_1 !is Number || this@case_6_1 !is Int || <!SENSELESS_COMPARISON!>this@case_6_1 == null<!>) }
|
||||
return this@case_6_1 !is Number || this@case_6_1 !is Int || <!SENSELESS_COMPARISON!>this@case_6_1 == null<!>
|
||||
}
|
||||
inline fun <reified T : Any?> T?.case_6_2(): Boolean {
|
||||
contract { returns(false) implies (this@case_6_2 !is Number || this@case_6_2 !is Int || this@case_6_2 == null) }
|
||||
contract { returns(false) implies (this@case_6_2 !is Number || this@case_6_2 !is Int || <!SENSELESS_COMPARISON!>this@case_6_2 == null<!>) }
|
||||
return !(this@case_6_2 !is Number || this@case_6_2 !is Int || <!SENSELESS_COMPARISON!>this@case_6_2 == null<!>)
|
||||
}
|
||||
inline fun <reified T : Any?> T?.case_6_3(): Boolean? {
|
||||
contract { returnsNotNull() implies (this@case_6_3 is Number && this@case_6_3 is Int && this@case_6_3 != null) }
|
||||
contract { returnsNotNull() implies (this@case_6_3 is Number && this@case_6_3 is Int && <!SENSELESS_COMPARISON!>this@case_6_3 != null<!>) }
|
||||
return if (this@case_6_3 is Number && this@case_6_3 is Int && <!SENSELESS_COMPARISON!>this@case_6_3 != null<!>) true else null
|
||||
}
|
||||
inline fun <reified T : Any?> T?.case_6_4(): Boolean? {
|
||||
contract { returns(null) implies (this@case_6_4 is Number && this@case_6_4 is Int && this@case_6_4 != null) }
|
||||
contract { returns(null) implies (this@case_6_4 is Number && this@case_6_4 is Int && <!SENSELESS_COMPARISON!>this@case_6_4 != null<!>) }
|
||||
return if (this@case_6_4 is Number && this@case_6_4 is Int && <!SENSELESS_COMPARISON!>this@case_6_4 != null<!>) null else true
|
||||
}
|
||||
|
||||
|
||||
Vendored
+10
-10
@@ -14,13 +14,13 @@ fun <T> T?.case_1(value_1: Int?) {
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
fun <T : Number?> T.case_2(value_2: Any?) {
|
||||
contract { returns() implies (this@case_2 !is Int || this@case_2 == null || value_2 !is Number || value_2 == null) }
|
||||
contract { returns() implies (this@case_2 !is Int || <!SENSELESS_COMPARISON!>this@case_2 == null<!> || value_2 !is Number || <!SENSELESS_COMPARISON!>value_2 == null<!>) }
|
||||
if (!(this@case_2 !is Int || <!SENSELESS_COMPARISON!>this@case_2 == null<!> || value_2 !is Number || <!SENSELESS_COMPARISON!>value_2 == null<!>)) throw Exception()
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
fun <T : Any?> T?.case_3(value_2: Any?) {
|
||||
contract { returns() implies (this@case_3 !is Number || this@case_3 !is Int || this@case_3 == null || value_2 == null) }
|
||||
contract { returns() implies (this@case_3 !is Number || this@case_3 !is Int || <!SENSELESS_COMPARISON!>this@case_3 == null<!> || value_2 == null) }
|
||||
if (!(this@case_3 !is Number || this@case_3 !is Int || <!SENSELESS_COMPARISON!>this@case_3 == null<!> || value_2 == null)) throw Exception()
|
||||
}
|
||||
|
||||
@@ -50,37 +50,37 @@ fun <T> T?.case_5_4(value_1: Int?): Boolean? {
|
||||
|
||||
// TESTCASE NUMBER: 6
|
||||
fun <T : Number?> T.case_6_1(value_2: Any?): Boolean {
|
||||
contract { returns(true) implies (this@case_6_1 !is Int || this@case_6_1 == null || value_2 !is Number || value_2 == null) }
|
||||
contract { returns(true) implies (this@case_6_1 !is Int || <!SENSELESS_COMPARISON!>this@case_6_1 == null<!> || value_2 !is Number || <!SENSELESS_COMPARISON!>value_2 == null<!>) }
|
||||
return this@case_6_1 !is Int || <!SENSELESS_COMPARISON!>this@case_6_1 == null<!> || value_2 !is Number || <!SENSELESS_COMPARISON!>value_2 == null<!>
|
||||
}
|
||||
fun <T : Number?> T.case_6_2(value_2: Any?): Boolean {
|
||||
contract { returns(false) implies (this@case_6_2 !is Int || this@case_6_2 == null || value_2 !is Number || value_2 == null) }
|
||||
contract { returns(false) implies (this@case_6_2 !is Int || <!SENSELESS_COMPARISON!>this@case_6_2 == null<!> || value_2 !is Number || <!SENSELESS_COMPARISON!>value_2 == null<!>) }
|
||||
return !(this@case_6_2 !is Int || <!SENSELESS_COMPARISON!>this@case_6_2 == null<!> || value_2 !is Number || <!SENSELESS_COMPARISON!>value_2 == null<!>)
|
||||
}
|
||||
fun <T : Number?> T.case_6_3(value_2: Any?): Boolean? {
|
||||
contract { returnsNotNull() implies (this@case_6_3 !is Int || this@case_6_3 == null || value_2 !is Number || value_2 == null) }
|
||||
contract { returnsNotNull() implies (this@case_6_3 !is Int || <!SENSELESS_COMPARISON!>this@case_6_3 == null<!> || value_2 !is Number || <!SENSELESS_COMPARISON!>value_2 == null<!>) }
|
||||
return if (this@case_6_3 !is Int || <!SENSELESS_COMPARISON!>this@case_6_3 == null<!> || value_2 !is Number || <!SENSELESS_COMPARISON!>value_2 == null<!>) true else null
|
||||
}
|
||||
fun <T : Number?> T.case_6_4(value_2: Any?): Boolean? {
|
||||
contract { returns(null) implies (this@case_6_4 !is Int || this@case_6_4 == null || value_2 !is Number || value_2 == null) }
|
||||
contract { returns(null) implies (this@case_6_4 !is Int || <!SENSELESS_COMPARISON!>this@case_6_4 == null<!> || value_2 !is Number || <!SENSELESS_COMPARISON!>value_2 == null<!>) }
|
||||
return if (this@case_6_4 !is Int || <!SENSELESS_COMPARISON!>this@case_6_4 == null<!> || value_2 !is Number || <!SENSELESS_COMPARISON!>value_2 == null<!>) null else true
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 7
|
||||
fun <T : Any?> T?.case_7_1(value_2: Any?): Boolean {
|
||||
contract { returns(true) implies (this@case_7_1 !is Number || this@case_7_1 !is Int || this@case_7_1 == null || value_2 == null) }
|
||||
contract { returns(true) implies (this@case_7_1 !is Number || this@case_7_1 !is Int || <!SENSELESS_COMPARISON!>this@case_7_1 == null<!> || value_2 == null) }
|
||||
return this@case_7_1 !is Number || this@case_7_1 !is Int || <!SENSELESS_COMPARISON!>this@case_7_1 == null<!> || value_2 == null
|
||||
}
|
||||
fun <T : Any?> T?.case_7_2(value_2: Any?): Boolean {
|
||||
contract { returns(false) implies (this@case_7_2 !is Number || this@case_7_2 !is Int || this@case_7_2 == null || value_2 == null) }
|
||||
contract { returns(false) implies (this@case_7_2 !is Number || this@case_7_2 !is Int || <!SENSELESS_COMPARISON!>this@case_7_2 == null<!> || value_2 == null) }
|
||||
return !(this@case_7_2 !is Number || this@case_7_2 !is Int || <!SENSELESS_COMPARISON!>this@case_7_2 == null<!> || value_2 == null)
|
||||
}
|
||||
fun <T : Any?> T?.case_7_3(value_2: Any?): Boolean? {
|
||||
contract { returnsNotNull() implies (this@case_7_3 !is Number || this@case_7_3 !is Int || this@case_7_3 == null || value_2 == null) }
|
||||
contract { returnsNotNull() implies (this@case_7_3 !is Number || this@case_7_3 !is Int || <!SENSELESS_COMPARISON!>this@case_7_3 == null<!> || value_2 == null) }
|
||||
return if (this@case_7_3 !is Number || this@case_7_3 !is Int || <!SENSELESS_COMPARISON!>this@case_7_3 == null<!> || value_2 == null) true else null
|
||||
}
|
||||
fun <T : Any?> T?.case_7_4(value_2: Any?): Boolean? {
|
||||
contract { returns(null) implies (this@case_7_4 !is Number || this@case_7_4 !is Int || this@case_7_4 == null || value_2 == null) }
|
||||
contract { returns(null) implies (this@case_7_4 !is Number || this@case_7_4 !is Int || <!SENSELESS_COMPARISON!>this@case_7_4 == null<!> || value_2 == null) }
|
||||
return if (this@case_7_4 !is Number || this@case_7_4 !is Int || <!SENSELESS_COMPARISON!>this@case_7_4 == null<!> || value_2 == null) null else true
|
||||
}
|
||||
|
||||
|
||||
Vendored
+10
-10
@@ -14,13 +14,13 @@ fun <T> T?.case_1() {
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
fun <T : Number?> T.case_2() {
|
||||
contract { returns() implies (this@case_2 is Int && this@case_2 != null) }
|
||||
contract { returns() implies (this@case_2 is Int && <!SENSELESS_COMPARISON!>this@case_2 != null<!>) }
|
||||
if (!(this@case_2 is Int && <!SENSELESS_COMPARISON!>this@case_2 != null<!>)) throw Exception()
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
inline fun <reified T : Any?> T?.case_3() {
|
||||
contract { returns() implies (this@case_3 is Number && this@case_3 is Int && this@case_3 != null) }
|
||||
contract { returns() implies (this@case_3 is Number && this@case_3 is Int && <!SENSELESS_COMPARISON!>this@case_3 != null<!>) }
|
||||
if (!(this@case_3 is Number && this@case_3 is Int && <!SENSELESS_COMPARISON!>this@case_3 != null<!>)) throw Exception()
|
||||
}
|
||||
|
||||
@@ -44,37 +44,37 @@ fun <T> T?.case_4_4(): Boolean? {
|
||||
|
||||
// TESTCASE NUMBER: 5
|
||||
fun <T : Number?> T.case_5_1(): Boolean {
|
||||
contract { returns(true) implies (this@case_5_1 is Int && this@case_5_1 != null) }
|
||||
contract { returns(true) implies (this@case_5_1 is Int && <!SENSELESS_COMPARISON!>this@case_5_1 != null<!>) }
|
||||
return this@case_5_1 is Int && <!SENSELESS_COMPARISON!>this@case_5_1 != null<!>
|
||||
}
|
||||
fun <T : Number?> T.case_5_2(): Boolean {
|
||||
contract { returns(false) implies (this@case_5_2 is Int && this@case_5_2 != null) }
|
||||
contract { returns(false) implies (this@case_5_2 is Int && <!SENSELESS_COMPARISON!>this@case_5_2 != null<!>) }
|
||||
return !(this@case_5_2 is Int && <!SENSELESS_COMPARISON!>this@case_5_2 != null<!>)
|
||||
}
|
||||
fun <T : Number?> T.case_5_3(): Boolean? {
|
||||
contract { returnsNotNull() implies (this@case_5_3 is Int && this@case_5_3 != null) }
|
||||
contract { returnsNotNull() implies (this@case_5_3 is Int && <!SENSELESS_COMPARISON!>this@case_5_3 != null<!>) }
|
||||
return if (this@case_5_3 is Int && <!SENSELESS_COMPARISON!>this@case_5_3 != null<!>) true else null
|
||||
}
|
||||
fun <T : Number?> T.case_5_4(): Boolean? {
|
||||
contract { returns(null) implies (this@case_5_4 is Int && this@case_5_4 != null) }
|
||||
contract { returns(null) implies (this@case_5_4 is Int && <!SENSELESS_COMPARISON!>this@case_5_4 != null<!>) }
|
||||
return if (this@case_5_4 is Int && <!SENSELESS_COMPARISON!>this@case_5_4 != null<!>) null else true
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 6
|
||||
inline fun <reified T : Any?> T?.case_6_1(): Boolean {
|
||||
contract { returns(true) implies (this@case_6_1 is Number && this@case_6_1 is Int && this@case_6_1 != null) }
|
||||
contract { returns(true) implies (this@case_6_1 is Number && this@case_6_1 is Int && <!SENSELESS_COMPARISON!>this@case_6_1 != null<!>) }
|
||||
return this@case_6_1 is Number && this@case_6_1 is Int && <!SENSELESS_COMPARISON!>this@case_6_1 != null<!>
|
||||
}
|
||||
inline fun <reified T : Any?> T?.case_6_2(): Boolean {
|
||||
contract { returns(false) implies (this@case_6_2 is Number && this@case_6_2 is Int && this@case_6_2 != null) }
|
||||
contract { returns(false) implies (this@case_6_2 is Number && this@case_6_2 is Int && <!SENSELESS_COMPARISON!>this@case_6_2 != null<!>) }
|
||||
return !(this@case_6_2 is Number && this@case_6_2 is Int && <!SENSELESS_COMPARISON!>this@case_6_2 != null<!>)
|
||||
}
|
||||
inline fun <reified T : Any?> T?.case_6_3(): Boolean? {
|
||||
contract { returnsNotNull() implies (this@case_6_3 is Number && this@case_6_3 is Int && this@case_6_3 != null) }
|
||||
contract { returnsNotNull() implies (this@case_6_3 is Number && this@case_6_3 is Int && <!SENSELESS_COMPARISON!>this@case_6_3 != null<!>) }
|
||||
return if (this@case_6_3 is Number && this@case_6_3 is Int && <!SENSELESS_COMPARISON!>this@case_6_3 != null<!>) true else null
|
||||
}
|
||||
inline fun <reified T : Any?> T?.case_6_4(): Boolean? {
|
||||
contract { returns(null) implies (this@case_6_4 is Number && this@case_6_4 is Int && this@case_6_4 != null) }
|
||||
contract { returns(null) implies (this@case_6_4 is Number && this@case_6_4 is Int && <!SENSELESS_COMPARISON!>this@case_6_4 != null<!>) }
|
||||
return if (this@case_6_4 is Number && this@case_6_4 is Int && <!SENSELESS_COMPARISON!>this@case_6_4 != null<!>) null else true
|
||||
}
|
||||
|
||||
|
||||
Vendored
+10
-10
@@ -14,13 +14,13 @@ fun <T> T?.case_1(value_1: Int?) {
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
fun <T : Number?> T.case_2(value_2: Any?) {
|
||||
contract { returns() implies (this@case_2 is Int && this@case_2 != null && value_2 is Number && value_2 != null) }
|
||||
contract { returns() implies (this@case_2 is Int && <!SENSELESS_COMPARISON!>this@case_2 != null<!> && value_2 is Number && <!SENSELESS_COMPARISON!>value_2 != null<!>) }
|
||||
if (!(this@case_2 is Int && <!SENSELESS_COMPARISON!>this@case_2 != null<!> && value_2 is Number && <!SENSELESS_COMPARISON!>value_2 != null<!>)) throw Exception()
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
fun <T : Any?> T?.case_3(value_2: Any?) {
|
||||
contract { returns() implies (this@case_3 is Number && this@case_3 is Int && this@case_3 != null && value_2 != null) }
|
||||
contract { returns() implies (this@case_3 is Number && this@case_3 is Int && <!SENSELESS_COMPARISON!>this@case_3 != null<!> && value_2 != null) }
|
||||
if (!(this@case_3 is Number && this@case_3 is Int && <!SENSELESS_COMPARISON!>this@case_3 != null<!> && value_2 != null)) throw Exception()
|
||||
}
|
||||
|
||||
@@ -50,37 +50,37 @@ fun <T> T?.case_5_4(value_1: Int?): Boolean? {
|
||||
|
||||
// TESTCASE NUMBER: 6
|
||||
fun <T : Number?> T.case_6_1(value_2: Any?): Boolean {
|
||||
contract { returns(true) implies (this@case_6_1 is Int && this@case_6_1 != null && value_2 is Number && value_2 != null) }
|
||||
contract { returns(true) implies (this@case_6_1 is Int && <!SENSELESS_COMPARISON!>this@case_6_1 != null<!> && value_2 is Number && <!SENSELESS_COMPARISON!>value_2 != null<!>) }
|
||||
return this@case_6_1 is Int && <!SENSELESS_COMPARISON!>this@case_6_1 != null<!> && value_2 is Number && <!SENSELESS_COMPARISON!>value_2 != null<!>
|
||||
}
|
||||
fun <T : Number?> T.case_6_2(value_2: Any?): Boolean {
|
||||
contract { returns(false) implies (this@case_6_2 is Int && this@case_6_2 != null && value_2 is Number && value_2 != null) }
|
||||
contract { returns(false) implies (this@case_6_2 is Int && <!SENSELESS_COMPARISON!>this@case_6_2 != null<!> && value_2 is Number && <!SENSELESS_COMPARISON!>value_2 != null<!>) }
|
||||
return !(this@case_6_2 is Int && <!SENSELESS_COMPARISON!>this@case_6_2 != null<!> && value_2 is Number && <!SENSELESS_COMPARISON!>value_2 != null<!>)
|
||||
}
|
||||
fun <T : Number?> T.case_6_3(value_2: Any?): Boolean? {
|
||||
contract { returnsNotNull() implies (this@case_6_3 is Int && this@case_6_3 != null && value_2 is Number && value_2 != null) }
|
||||
contract { returnsNotNull() implies (this@case_6_3 is Int && <!SENSELESS_COMPARISON!>this@case_6_3 != null<!> && value_2 is Number && <!SENSELESS_COMPARISON!>value_2 != null<!>) }
|
||||
return if (this@case_6_3 is Int && <!SENSELESS_COMPARISON!>this@case_6_3 != null<!> && value_2 is Number && <!SENSELESS_COMPARISON!>value_2 != null<!>) true else null
|
||||
}
|
||||
fun <T : Number?> T.case_6_4(value_2: Any?): Boolean? {
|
||||
contract { returns(null) implies (this@case_6_4 is Int && this@case_6_4 != null && value_2 is Number && value_2 != null) }
|
||||
contract { returns(null) implies (this@case_6_4 is Int && <!SENSELESS_COMPARISON!>this@case_6_4 != null<!> && value_2 is Number && <!SENSELESS_COMPARISON!>value_2 != null<!>) }
|
||||
return if (this@case_6_4 is Int && <!SENSELESS_COMPARISON!>this@case_6_4 != null<!> && value_2 is Number && <!SENSELESS_COMPARISON!>value_2 != null<!>) null else true
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 7
|
||||
fun <T : Any?> T?.case_7_1(value_2: Any?): Boolean {
|
||||
contract { returns(true) implies (this@case_7_1 is Number && this@case_7_1 is Int && this@case_7_1 != null && value_2 != null) }
|
||||
contract { returns(true) implies (this@case_7_1 is Number && this@case_7_1 is Int && <!SENSELESS_COMPARISON!>this@case_7_1 != null<!> && value_2 != null) }
|
||||
return this@case_7_1 is Number && this@case_7_1 is Int && <!SENSELESS_COMPARISON!>this@case_7_1 != null<!> && value_2 != null
|
||||
}
|
||||
fun <T : Any?> T?.case_7_2(value_2: Any?): Boolean {
|
||||
contract { returns(true) implies (this@case_7_2 is Number && this@case_7_2 is Int && this@case_7_2 != null && value_2 != null) }
|
||||
contract { returns(true) implies (this@case_7_2 is Number && this@case_7_2 is Int && <!SENSELESS_COMPARISON!>this@case_7_2 != null<!> && value_2 != null) }
|
||||
return this@case_7_2 is Number && this@case_7_2 is Int && <!SENSELESS_COMPARISON!>this@case_7_2 != null<!> && value_2 != null
|
||||
}
|
||||
fun <T : Any?> T?.case_7_3(value_2: Any?): Boolean? {
|
||||
contract { returnsNotNull() implies (this@case_7_3 is Number && this@case_7_3 is Int && this@case_7_3 != null && value_2 != null) }
|
||||
contract { returnsNotNull() implies (this@case_7_3 is Number && this@case_7_3 is Int && <!SENSELESS_COMPARISON!>this@case_7_3 != null<!> && value_2 != null) }
|
||||
return if (this@case_7_3 is Number && this@case_7_3 is Int && <!SENSELESS_COMPARISON!>this@case_7_3 != null<!> && value_2 != null) true else null
|
||||
}
|
||||
fun <T : Any?> T?.case_7_4(value_2: Any?): Boolean? {
|
||||
contract { returns(null) implies (this@case_7_4 is Number && this@case_7_4 is Int && this@case_7_4 != null && value_2 != null) }
|
||||
contract { returns(null) implies (this@case_7_4 is Number && this@case_7_4 is Int && <!SENSELESS_COMPARISON!>this@case_7_4 != null<!> && value_2 != null) }
|
||||
return if (this@case_7_4 is Number && this@case_7_4 is Int && <!SENSELESS_COMPARISON!>this@case_7_4 != null<!> && value_2 != null) null else true
|
||||
}
|
||||
|
||||
|
||||
+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