[FIR] Add CAST_NEVER_SUCCEEDS
This commit is contained in:
committed by
TeamCityServer
parent
4ca757446a
commit
2b5524b18f
+2
-2
@@ -47,7 +47,7 @@ fun case_5(value_1: Int?) {
|
||||
println("!")
|
||||
contract {
|
||||
returns(true) implies (value_1 != null)
|
||||
} as ContractBuilder
|
||||
} <!CAST_NEVER_SUCCEEDS!>as<!> ContractBuilder
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -93,6 +93,6 @@ fun case_9(number: Int?): Boolean {
|
||||
val value_1 = number != null
|
||||
contract {
|
||||
returns(false) implies (value_1)
|
||||
} as ContractBuilder
|
||||
} <!CAST_NEVER_SUCCEEDS!>as<!> ContractBuilder
|
||||
return number == null
|
||||
}
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@ fun case_1(value_1: Int?) {
|
||||
println("!")
|
||||
contract {
|
||||
returns(true) implies (value_1 != null)
|
||||
} as ContractBuilder
|
||||
} <!CAST_NEVER_SUCCEEDS!>as<!> ContractBuilder
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
@@ -42,6 +42,6 @@ fun case_5(number: Int?): Boolean {
|
||||
val value_1 = number != null
|
||||
contract {
|
||||
returns(false) implies (value_1)
|
||||
} as ContractBuilder
|
||||
} <!CAST_NEVER_SUCCEEDS!>as<!> ContractBuilder
|
||||
return number == null
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
fun case_1(x: Interface1) = x
|
||||
fun case_1(x: Interface2) = x
|
||||
fun case_1() {
|
||||
val x: Interface1 = null as Interface1
|
||||
val x: Interface1 = null <!CAST_NEVER_SUCCEEDS!>as<!> Interface1
|
||||
x as Interface2
|
||||
<!OVERLOAD_RESOLUTION_AMBIGUITY!>case_1<!>(<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & Interface2 & Interface1")!>x<!>)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user