[FIR] Properly track problems in contract description during effect extraction

This commit is contained in:
Dmitriy Novozhilov
2023-04-12 17:31:16 +03:00
committed by Space Team
parent 79d378f2bd
commit 5a92eb2c67
34 changed files with 563 additions and 102 deletions
@@ -5,7 +5,7 @@ import kotlin.contracts.*
// TESTCASE NUMBER: 1
inline fun case_1(block: () -> Unit) {
contract { }
<!ERROR_IN_CONTRACT_DESCRIPTION!>contract { }<!>
return block()
}
@@ -11,24 +11,24 @@ object SampleObject {
// TESTCASE NUMBER: 1
inline fun case_1(invocationKind: InvocationKind, block: () -> Unit) {
contract { callsInPlace(block, invocationKind) }
contract { <!ERROR_IN_CONTRACT_DESCRIPTION!>callsInPlace(block, invocationKind)<!> }
return block()
}
// TESTCASE NUMBER: 2
inline fun <T : InvocationKind> case_2(invocationKind: T, block: () -> Unit) {
contract { callsInPlace(block, invocationKind) }
contract { <!ERROR_IN_CONTRACT_DESCRIPTION!>callsInPlace(block, invocationKind)<!> }
return block()
}
// TESTCASE NUMBER: 3
inline fun case_3(block: () -> Unit) {
contract { callsInPlace(block, invocationKind) }
contract { <!ERROR_IN_CONTRACT_DESCRIPTION!>callsInPlace(block, invocationKind)<!> }
return block()
}
// TESTCASE NUMBER: 4
inline fun case_4(block: () -> Unit) {
contract { callsInPlace(block, SampleObject.invocationKind) }
contract { <!ERROR_IN_CONTRACT_DESCRIPTION!>callsInPlace(block, SampleObject.invocationKind)<!> }
return block()
}