Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/callUsualContractFunction.fir.kt
T
Dmitriy Novozhilov f283f2db43 [FIR] Improve diagnostic reporting & don't use error symbol for candidate if possible
Also introduce few new diagnostics:
- NONE_APPLICABLE more many inapplicable candidates
- HIDDEN for visible candidates
2020-07-28 20:46:56 +03:00

43 lines
778 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_PARAMETER
package my
// Accepts block, can't be distinguished from kotlin.contract without resolve
fun contract(block: () -> Unit) {}
// Accepts int, potentially can be distinguished from kotlin.contract by PSI,
// but as of Kotlin 1.3.0, we don't do that
fun contract(i: Int) {}
fun doStuff() {}
class SomeClass {
fun contract() {}
fun callMemberContractWithThis() {
this.contract()
}
fun callMemberContractWithoutThis() {
<!NONE_APPLICABLE!>contract<!>()
}
fun callTopLevelSamePsiInMember() {
contract { }
}
}
fun callTopLevelSamePsi() {
contract { }
}
fun callTopLevelDifferentPsi() {
contract(42)
}
fun callTopLevelSamePsiNotFirstStatement() {
doStuff()
contract { }
}