FIR: unwrap smartcast expression when extracting effects of contract
This commit is contained in:
committed by
TeamCityServer
parent
70f462781a
commit
3d635b6a94
Vendored
+1
-1
@@ -31,5 +31,5 @@ fun case_1(value_1: Any?) {
|
||||
// TESTCASE NUMBER: 2
|
||||
fun case_2(value_1: Any?, value_2: Number, value_3: Any?, value_4: String?) {
|
||||
value_1.case_2(value_2, value_3, value_4)
|
||||
<!AMBIGUITY!>println<!>(value_1.<!UNRESOLVED_REFERENCE!>toByte<!>())
|
||||
println(value_1.toByte())
|
||||
}
|
||||
|
||||
Vendored
+4
-4
@@ -51,8 +51,8 @@ class case_3 {
|
||||
fun case_3(value_1: Any?, value_2: Number?) {
|
||||
val o = case_3()
|
||||
contracts.case_3(value_1, value_2, o.prop_1, this.prop_1)
|
||||
<!AMBIGUITY!>println<!>(o.prop_1.<!NONE_APPLICABLE!>plus<!>(3))
|
||||
<!AMBIGUITY!>println<!>(this.prop_1.<!NONE_APPLICABLE!>plus<!>(3))
|
||||
println(o.prop_1.plus(3))
|
||||
println(this.prop_1.plus(3))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,8 +62,8 @@ class case_4 {
|
||||
fun case_4(value_1: Any?, value_2: Number?) {
|
||||
val o = case_4()
|
||||
if (contracts.case_4(value_1, value_2, o.prop_1, this.prop_1)) {
|
||||
<!AMBIGUITY!>println<!>(o.prop_1.<!NONE_APPLICABLE!>plus<!>(3))
|
||||
<!AMBIGUITY!>println<!>(this.prop_1.<!NONE_APPLICABLE!>plus<!>(3))
|
||||
println(o.prop_1.plus(3))
|
||||
println(this.prop_1.plus(3))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -31,5 +31,5 @@ fun case_1(value_1: Any?) {
|
||||
// TESTCASE NUMBER: 2
|
||||
fun case_2(value_1: Any?, value_2: Number, value_3: Any?, value_4: String?) {
|
||||
value_1.case_2(value_2, value_3, value_4)
|
||||
<!AMBIGUITY!>println<!>(value_1.<!UNRESOLVED_REFERENCE!>toByte<!>())
|
||||
println(value_1.toByte())
|
||||
}
|
||||
|
||||
Vendored
+10
-10
@@ -102,9 +102,9 @@ class case_3_class {
|
||||
fun case_3(value_1: Any?, value_2: Number?) {
|
||||
val o = case_3_class()
|
||||
contracts.case_3(value_1, value_2, o.prop_1, this.prop_1)
|
||||
println(value_1.<!INAPPLICABLE_CANDIDATE!>dec<!>())
|
||||
println(value_1.dec())
|
||||
println(value_2?.toByte())
|
||||
<!AMBIGUITY!>println<!>(o.prop_1.<!NONE_APPLICABLE!>plus<!>(3))
|
||||
println(o.prop_1.plus(3))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,24 +154,24 @@ class case_6_class {
|
||||
fun case_6(value_1: Any?, value_2: Number?) {
|
||||
val o = case_6_class()
|
||||
if (contracts.case_6_1(value_1, value_2, o.prop_1, this.prop_1)) {
|
||||
println(value_1.<!INAPPLICABLE_CANDIDATE!>dec<!>())
|
||||
println(value_1.dec())
|
||||
println(value_2?.toByte())
|
||||
<!AMBIGUITY!>println<!>(o.prop_1.<!NONE_APPLICABLE!>plus<!>(3))
|
||||
println(o.prop_1.plus(3))
|
||||
}
|
||||
if (!contracts.case_6_2(value_1, value_2, o.prop_1, this.prop_1)) {
|
||||
println(value_1.<!INAPPLICABLE_CANDIDATE!>dec<!>())
|
||||
println(value_1.dec())
|
||||
println(value_2?.toByte())
|
||||
<!AMBIGUITY!>println<!>(o.prop_1.<!NONE_APPLICABLE!>plus<!>(3))
|
||||
println(o.prop_1.plus(3))
|
||||
}
|
||||
if (contracts.case_6_3(value_1, value_2, o.prop_1, this.prop_1) != null) {
|
||||
println(value_1.<!INAPPLICABLE_CANDIDATE!>dec<!>())
|
||||
println(value_1.dec())
|
||||
println(value_2?.toByte())
|
||||
<!AMBIGUITY!>println<!>(o.prop_1.<!NONE_APPLICABLE!>plus<!>(3))
|
||||
println(o.prop_1.plus(3))
|
||||
}
|
||||
if (contracts.case_6_4(value_1, value_2, o.prop_1, this.prop_1) == null) {
|
||||
println(value_1.<!INAPPLICABLE_CANDIDATE!>dec<!>())
|
||||
println(value_1.dec())
|
||||
println(value_2?.toByte())
|
||||
<!AMBIGUITY!>println<!>(o.prop_1.<!NONE_APPLICABLE!>plus<!>(3))
|
||||
println(o.prop_1.plus(3))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+15
-15
@@ -85,41 +85,41 @@ import contracts.*
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1(value_1: Any?) {
|
||||
value_1.case_1()
|
||||
<!AMBIGUITY!>println<!>(value_1.<!UNRESOLVED_REFERENCE!>length<!>)
|
||||
println(value_1.length)
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
fun case_2(value_1: Number?) {
|
||||
value_1.case_2()
|
||||
<!AMBIGUITY!>println<!>(value_1.<!UNRESOLVED_REFERENCE!>inv<!>())
|
||||
println(value_1.inv())
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
fun case_3(value_1: Any?) {
|
||||
value_1.case_3()
|
||||
<!AMBIGUITY!>println<!>(value_1.<!UNRESOLVED_REFERENCE!>inv<!>())
|
||||
println(value_1.inv())
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 4
|
||||
fun case_4(value_1: Any?, value_2: Any?, value_3: Any?) {
|
||||
when { value_1.case_4_1() -> <!AMBIGUITY!>println<!>(value_1.<!UNRESOLVED_REFERENCE!>length<!>) }
|
||||
when { !value_2.case_4_2() -> <!AMBIGUITY!>println<!>(value_2.<!UNRESOLVED_REFERENCE!>length<!>) }
|
||||
when { value_3.case_4_3() != null -> <!AMBIGUITY!>println<!>(value_3.<!UNRESOLVED_REFERENCE!>length<!>) }
|
||||
when { value_3.case_4_4() == null -> <!AMBIGUITY!>println<!>(value_3.<!UNRESOLVED_REFERENCE!>length<!>) }
|
||||
when { value_1.case_4_1() -> println(value_1.length) }
|
||||
when { !value_2.case_4_2() -> println(value_2.length) }
|
||||
when { value_3.case_4_3() != null -> println(value_3.length) }
|
||||
when { value_3.case_4_4() == null -> println(value_3.length) }
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 5
|
||||
fun case_5(value_1: Number?, value_2: Number?, value_3: Number?) {
|
||||
if (value_1.case_5_1()) <!AMBIGUITY!>println<!>(value_1.<!UNRESOLVED_REFERENCE!>inv<!>())
|
||||
if (!value_2.case_5_2()) <!AMBIGUITY!>println<!>(value_2.<!UNRESOLVED_REFERENCE!>inv<!>())
|
||||
if (value_3.case_5_3() != null) <!AMBIGUITY!>println<!>(value_3.<!UNRESOLVED_REFERENCE!>inv<!>())
|
||||
if (value_3.case_5_4() == null) <!AMBIGUITY!>println<!>(value_3.<!UNRESOLVED_REFERENCE!>inv<!>())
|
||||
if (value_1.case_5_1()) println(value_1.inv())
|
||||
if (!value_2.case_5_2()) println(value_2.inv())
|
||||
if (value_3.case_5_3() != null) println(value_3.inv())
|
||||
if (value_3.case_5_4() == null) println(value_3.inv())
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 6
|
||||
fun case_6(value_1: Any?, value_2: Any?, value_3: Any?) {
|
||||
if (value_1.case_6_1()) <!AMBIGUITY!>println<!>(value_1.<!UNRESOLVED_REFERENCE!>inv<!>())
|
||||
if (!value_2.case_6_2()) <!AMBIGUITY!>println<!>(value_2.<!UNRESOLVED_REFERENCE!>inv<!>())
|
||||
if (value_3.case_6_3() != null) <!AMBIGUITY!>println<!>(value_3.<!UNRESOLVED_REFERENCE!>inv<!>())
|
||||
if (value_3.case_6_4() == null) <!AMBIGUITY!>println<!>(value_3.<!UNRESOLVED_REFERENCE!>inv<!>())
|
||||
if (value_1.case_6_1()) println(value_1.inv())
|
||||
if (!value_2.case_6_2()) println(value_2.inv())
|
||||
if (value_3.case_6_3() != null) println(value_3.inv())
|
||||
if (value_3.case_6_4() == null) println(value_3.inv())
|
||||
}
|
||||
|
||||
Vendored
+45
-45
@@ -109,56 +109,56 @@ import contracts.*
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1(value_1: Any?, value_2: Int?) {
|
||||
value_1.case_1(value_2)
|
||||
<!AMBIGUITY!>println<!>(value_1.<!UNRESOLVED_REFERENCE!>length<!>)
|
||||
println(value_2<!UNSAFE_CALL!>.<!>inv())
|
||||
println(value_1.length)
|
||||
println(value_2.inv())
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
fun case_2(value_1: Number?, value_2: Any?) {
|
||||
value_1.case_2(value_2)
|
||||
<!AMBIGUITY!>println<!>(value_1.<!UNRESOLVED_REFERENCE!>inv<!>())
|
||||
<!AMBIGUITY!>println<!>(value_2.<!UNRESOLVED_REFERENCE!>toByte<!>())
|
||||
println(value_1.inv())
|
||||
println(value_2.toByte())
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
fun case_3(value_1: Any?, value_2: String?) {
|
||||
value_1.case_3(value_2)
|
||||
<!AMBIGUITY!>println<!>(value_1.<!UNRESOLVED_REFERENCE!>inv<!>())
|
||||
println(value_2<!UNSAFE_CALL!>.<!>length)
|
||||
println(value_1.inv())
|
||||
println(value_2.length)
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 4
|
||||
fun case_4(value_1: Any?, value_2: Number, value_3: Any?, value_4: String?) {
|
||||
value_1.case_4(value_2, value_3, value_4)
|
||||
<!AMBIGUITY!>println<!>(value_2.<!UNRESOLVED_REFERENCE!>inv<!>())
|
||||
<!AMBIGUITY!>println<!>(value_3.<!UNRESOLVED_REFERENCE!>toByte<!>())
|
||||
println(value_4<!UNSAFE_CALL!>.<!>length)
|
||||
println(value_2.inv())
|
||||
println(value_3.toByte())
|
||||
println(value_4.length)
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 5
|
||||
fun case_5(value_1: Any?, value_2: Int?, value_3: Any?, value_4: Int?, value_5: Any?, value_6: Int?) {
|
||||
when {
|
||||
value_1.case_5_1(value_2) -> {
|
||||
<!AMBIGUITY!>println<!>(value_1.<!UNRESOLVED_REFERENCE!>length<!>)
|
||||
println(value_2<!UNSAFE_CALL!>.<!>inv())
|
||||
println(value_1.length)
|
||||
println(value_2.inv())
|
||||
}
|
||||
}
|
||||
when {
|
||||
!value_3.case_5_2(value_4) -> {
|
||||
<!AMBIGUITY!>println<!>(value_3.<!UNRESOLVED_REFERENCE!>length<!>)
|
||||
println(value_4<!UNSAFE_CALL!>.<!>inv())
|
||||
println(value_3.length)
|
||||
println(value_4.inv())
|
||||
}
|
||||
}
|
||||
when {
|
||||
value_5.case_5_3(value_6) != null -> {
|
||||
<!AMBIGUITY!>println<!>(value_5.<!UNRESOLVED_REFERENCE!>length<!>)
|
||||
println(value_6<!UNSAFE_CALL!>.<!>inv())
|
||||
println(value_5.length)
|
||||
println(value_6.inv())
|
||||
}
|
||||
}
|
||||
when {
|
||||
value_5.case_5_4(value_6) == null -> {
|
||||
<!AMBIGUITY!>println<!>(value_5.<!UNRESOLVED_REFERENCE!>length<!>)
|
||||
println(value_6<!UNSAFE_CALL!>.<!>inv())
|
||||
println(value_5.length)
|
||||
println(value_6.inv())
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -166,55 +166,55 @@ fun case_5(value_1: Any?, value_2: Int?, value_3: Any?, value_4: Int?, value_5:
|
||||
// TESTCASE NUMBER: 6
|
||||
fun case_6(value_1: Number?, value_2: Any?, value_3: Number?, value_4: Any?, value_5: Number?, value_6: Any?) {
|
||||
if (value_1.case_6_1(value_2)) {
|
||||
<!AMBIGUITY!>println<!>(value_1.<!UNRESOLVED_REFERENCE!>inv<!>())
|
||||
<!AMBIGUITY!>println<!>(value_2.<!UNRESOLVED_REFERENCE!>toByte<!>())
|
||||
println(value_1.inv())
|
||||
println(value_2.toByte())
|
||||
}
|
||||
if (!value_3.case_6_2(value_4)) {
|
||||
<!AMBIGUITY!>println<!>(value_3.<!UNRESOLVED_REFERENCE!>inv<!>())
|
||||
<!AMBIGUITY!>println<!>(value_4.<!UNRESOLVED_REFERENCE!>toByte<!>())
|
||||
println(value_3.inv())
|
||||
println(value_4.toByte())
|
||||
}
|
||||
if (value_5.case_6_3(value_6) != null) {
|
||||
<!AMBIGUITY!>println<!>(value_5.<!UNRESOLVED_REFERENCE!>inv<!>())
|
||||
<!AMBIGUITY!>println<!>(value_6.<!UNRESOLVED_REFERENCE!>toByte<!>())
|
||||
println(value_5.inv())
|
||||
println(value_6.toByte())
|
||||
}
|
||||
if (value_5.case_6_4(value_6) == null) {
|
||||
<!AMBIGUITY!>println<!>(value_5.<!UNRESOLVED_REFERENCE!>inv<!>())
|
||||
<!AMBIGUITY!>println<!>(value_6.<!UNRESOLVED_REFERENCE!>toByte<!>())
|
||||
println(value_5.inv())
|
||||
println(value_6.toByte())
|
||||
}
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 7
|
||||
fun case_7(value_1: Any?, value_2: String?, value_3: Any?, value_4: String?, value_5: Any?, value_6: String?) {
|
||||
if (value_1.case_7_1(value_2)) {
|
||||
<!AMBIGUITY!>println<!>(value_1.<!UNRESOLVED_REFERENCE!>inv<!>())
|
||||
println(value_2<!UNSAFE_CALL!>.<!>length)
|
||||
println(value_1.inv())
|
||||
println(value_2.length)
|
||||
}
|
||||
if (value_3.case_7_2(value_4)) {
|
||||
<!AMBIGUITY!>println<!>(value_3.<!UNRESOLVED_REFERENCE!>inv<!>())
|
||||
println(value_4<!UNSAFE_CALL!>.<!>length)
|
||||
println(value_3.inv())
|
||||
println(value_4.length)
|
||||
}
|
||||
if (value_5.case_7_3(value_6) != null) {
|
||||
<!AMBIGUITY!>println<!>(value_5.<!UNRESOLVED_REFERENCE!>inv<!>())
|
||||
println(value_6<!UNSAFE_CALL!>.<!>length)
|
||||
println(value_5.inv())
|
||||
println(value_6.length)
|
||||
}
|
||||
if (value_5.case_7_4(value_6) == null) {
|
||||
<!AMBIGUITY!>println<!>(value_5.<!UNRESOLVED_REFERENCE!>inv<!>())
|
||||
println(value_6<!UNSAFE_CALL!>.<!>length)
|
||||
println(value_5.inv())
|
||||
println(value_6.length)
|
||||
}
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 8
|
||||
fun case_8(value_1: Any?, value_2: Number, value_3: Any?, value_4: String?, value_5: Any?, value_6: Number, value_7: Any?, value_8: String?) {
|
||||
when { value_1.case_8_1(value_2, value_3, value_4) -> <!AMBIGUITY!>println<!>(value_2.<!UNRESOLVED_REFERENCE!>inv<!>()) }
|
||||
when { value_1.case_8_1(value_2, value_3, value_4) -> <!AMBIGUITY!>println<!>(value_3.<!UNRESOLVED_REFERENCE!>toByte<!>()) }
|
||||
when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_4<!UNSAFE_CALL!>.<!>length) }
|
||||
when { !value_5.case_8_2(value_6, value_7, value_8) -> <!AMBIGUITY!>println<!>(value_6.<!UNRESOLVED_REFERENCE!>inv<!>()) }
|
||||
when { !value_5.case_8_2(value_6, value_7, value_8) -> <!AMBIGUITY!>println<!>(value_7.<!UNRESOLVED_REFERENCE!>toByte<!>()) }
|
||||
when { !value_5.case_8_2(value_6, value_7, value_8) -> println(value_8<!UNSAFE_CALL!>.<!>length) }
|
||||
when { value_5.case_8_3(value_6, value_7, value_8) != null -> <!AMBIGUITY!>println<!>(value_6.<!UNRESOLVED_REFERENCE!>inv<!>()) }
|
||||
when { value_5.case_8_3(value_6, value_7, value_8) != null -> <!AMBIGUITY!>println<!>(value_7.<!UNRESOLVED_REFERENCE!>toByte<!>()) }
|
||||
when { value_5.case_8_3(value_6, value_7, value_8) != null -> println(value_8<!UNSAFE_CALL!>.<!>length) }
|
||||
when { value_5.case_8_4(value_6, value_7, value_8) == null -> <!AMBIGUITY!>println<!>(value_6.<!UNRESOLVED_REFERENCE!>inv<!>()) }
|
||||
when { value_5.case_8_4(value_6, value_7, value_8) == null -> <!AMBIGUITY!>println<!>(value_7.<!UNRESOLVED_REFERENCE!>toByte<!>()) }
|
||||
when { value_5.case_8_4(value_6, value_7, value_8) == null -> println(value_8<!UNSAFE_CALL!>.<!>length) }
|
||||
when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_2.inv()) }
|
||||
when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_3.toByte()) }
|
||||
when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_4.length) }
|
||||
when { !value_5.case_8_2(value_6, value_7, value_8) -> println(value_6.inv()) }
|
||||
when { !value_5.case_8_2(value_6, value_7, value_8) -> println(value_7.toByte()) }
|
||||
when { !value_5.case_8_2(value_6, value_7, value_8) -> println(value_8.length) }
|
||||
when { value_5.case_8_3(value_6, value_7, value_8) != null -> println(value_6.inv()) }
|
||||
when { value_5.case_8_3(value_6, value_7, value_8) != null -> println(value_7.toByte()) }
|
||||
when { value_5.case_8_3(value_6, value_7, value_8) != null -> println(value_8.length) }
|
||||
when { value_5.case_8_4(value_6, value_7, value_8) == null -> println(value_6.inv()) }
|
||||
when { value_5.case_8_4(value_6, value_7, value_8) == null -> println(value_7.toByte()) }
|
||||
when { value_5.case_8_4(value_6, value_7, value_8) == null -> println(value_8.length) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user