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

30 lines
768 B
Kotlin
Vendored

// !WITH_NEW_INFERENCE
// !CHECK_TYPE
// !DIAGNOSTICS: -UNUSED_PARAMETER, -UNUSED_VARIABLE
class AbstractSelector<S, I>
class SelectorFor<S>
inline operator fun <S, I> SelectorFor<S>.invoke(f: S.() -> I): AbstractSelector<S, I> = TODO()
class State(val p1: Double, val p2: () -> Int, val p3: String?)
fun test(s: SelectorFor<State>): Double {
val a = s { p1 }
a checkType { _<AbstractSelector<State, Double>>() }
val b = s { p2 }
b checkType { _<AbstractSelector<State, () -> Int>>()}
val c = s { p3 }
c checkType { _<AbstractSelector<State, String?>>() }
val d = s { }
d checkType { _<AbstractSelector<State, Unit>>() }
val e = s { return p1 }
e checkType { _<AbstractSelector<State, Nothing>>() }
return null!!
}