Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/KtFirCompositeScope.kt
T
2021-04-13 21:36:38 +03:00

19 lines
468 B
Kotlin
Vendored

interface KtScope {
fun getAllNames(): Set<String>
}
inline fun <E> buildSet(@BuilderInference builderAction: MutableSet<E>.() -> Unit): Set<E> {
return null!!
}
inline fun <R> withValidityAssertion(action: () -> R): R {
return action()
}
class KtFirCompositeScope(val subScopes: List<KtScope>) {
fun getAllNames(): Set<String> = withValidityAssertion {
buildSet {
subScopes.flatMapTo(this) { it.getAllNames() }
}
}
}