Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/publicApproximation/chainedLambdas.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

35 lines
694 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_PARAMETER
// !WITH_NEW_INFERENCE
// NI_EXPECTED_FILE
interface First {
fun first() {}
}
interface Second
interface Third
interface Fourth
fun chained1(arg: First) = run {
if (arg !is Second) throw Exception()
arg
}.let { third ->
if (third !is Third) throw Exception()
third
}
fun chained2(arg: First) = run {
if (arg !is Second) throw Exception()
arg
}.let { third ->
if (third !is Third) throw Exception()
third
}.let { fourth ->
if (fourth !is Fourth) throw Exception()
fourth
}
fun test(arg: First) {
chained1(arg).<!UNRESOLVED_REFERENCE{NI}!>first<!>()
chained2(arg).<!UNRESOLVED_REFERENCE{NI}!>first<!>()
}