[FIR] Fix Disappeared CONTRACT_NOT_ALLOWED
https://youtrack.jetbrains.com/issue/KT-60004/K2-Disappeared-CONTRACTNOTALLOWED Merge-request: KT-MR-12613 Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
834927a901
commit
0fb853a995
@@ -0,0 +1,20 @@
|
||||
// FIR_IDENTICAL
|
||||
// !OPT_IN: kotlin.contracts.ExperimentalContracts
|
||||
|
||||
/*
|
||||
* ADDITION TO `KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (POSITIVE)`
|
||||
*
|
||||
* SECTIONS: contracts, declarations, contractBuilder, common
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: Functions with simple contracts.
|
||||
*/
|
||||
|
||||
import kotlin.contracts.*
|
||||
|
||||
// The following is an useful addition to testcases in compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/pos/1.kt
|
||||
|
||||
// TESTCASE NUMBER: 4
|
||||
inline fun case_4(block: () -> Unit) {
|
||||
kotlin.contracts.contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) }
|
||||
return block()
|
||||
}
|
||||
Reference in New Issue
Block a user