Files
kotlin-fork/compiler/testData/diagnostics/tests/AutoCreatedIt.kt
T
Dmitriy Novozhilov e6b5cb5216 [TD] Update diagnostics test data due to new test runners
Update includes:
- Changing syntax of `OI/`NI` tags from `<!NI;TAG!>` to `<!TAG{NI}!>`
- Fix some incorrect directives
- Change order of diagnostics in some places
- Remove ignored diagnostics from FIR test data (previously `DIAGNOSTICS` didn't work)
- Update FIR dumps in some places and add `FIR_IDENTICAL` if needed
- Replace all JAVAC_SKIP with SKIP_JAVAC directive
2020-12-16 19:52:25 +03:00

34 lines
1.2 KiB
Kotlin
Vendored

// !WITH_NEW_INFERENCE
fun text() {
"direct:a" to "mock:a"
"direct:a" on {it.body == "<hello/>"} to "mock:a"
"direct:a" on {it -> it.body == "<hello/>"} to "mock:a"
bar <!EXPECTED_PARAMETERS_NUMBER_MISMATCH!>{<!>1}
bar <!EXPECTED_PARAMETERS_NUMBER_MISMATCH!>{<!><!UNRESOLVED_REFERENCE!>it<!> <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE{OI}, DEBUG_INFO_MISSING_UNRESOLVED{NI}!>+<!> 1}
bar {it, <!UNUSED_ANONYMOUS_PARAMETER!>it1<!> -> it}
bar1 {1}
bar1 {it + 1}
bar2 <!TYPE_MISMATCH{NI}!>{<!TYPE_MISMATCH!><!>}<!>
bar2 {1}
bar2 <!TYPE_MISMATCH{NI}!>{<!UNRESOLVED_REFERENCE!>it<!>}<!>
bar2 <!TYPE_MISMATCH{NI}!>{<!CANNOT_INFER_PARAMETER_TYPE, EXPECTED_PARAMETERS_NUMBER_MISMATCH!>it<!> -> <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>it<!>}<!>
}
fun bar(<!UNUSED_PARAMETER!>f<!> : (Int, Int) -> Int) {}
fun bar1(<!UNUSED_PARAMETER!>f<!> : (Int) -> Int) {}
fun bar2(<!UNUSED_PARAMETER!>f<!> : () -> Int) {}
infix fun String.to(<!UNUSED_PARAMETER!>dest<!> : String) {
}
infix fun String.on(<!UNUSED_PARAMETER!>predicate<!> : (s : URI) -> Boolean) : URI {
return URI(this)
}
class URI(val body : Any) {
infix fun to(<!UNUSED_PARAMETER!>dest<!> : String) {}
}