FIR: add test fixing builder inference case
This commit is contained in:
Vendored
+33
@@ -0,0 +1,33 @@
|
||||
FILE: KtFirCompositeScope.kt
|
||||
public abstract interface KtScope : R|kotlin/Any| {
|
||||
public abstract fun getAllNames(): R|kotlin/collections/Set<kotlin/String>|
|
||||
|
||||
}
|
||||
public final inline fun <E> buildSet(@R|kotlin/BuilderInference|() builderAction: R|kotlin/collections/MutableSet<E>.() -> kotlin/Unit|): R|kotlin/collections/Set<E>| {
|
||||
^buildSet Null(null)!!
|
||||
}
|
||||
public final inline fun <R> withValidityAssertion(action: R|() -> R|): R|R| {
|
||||
^withValidityAssertion R|<local>/action|.R|SubstitutionOverride<kotlin/Function0.invoke: R|R|>|()
|
||||
}
|
||||
public final class KtFirCompositeScope : R|kotlin/Any| {
|
||||
public constructor(subScopes: R|kotlin/collections/List<KtScope>|): R|KtFirCompositeScope| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final val subScopes: R|kotlin/collections/List<KtScope>| = R|<local>/subScopes|
|
||||
public get(): R|kotlin/collections/List<KtScope>|
|
||||
|
||||
public final fun getAllNames(): R|kotlin/collections/Set<kotlin/String>| {
|
||||
^getAllNames R|/withValidityAssertion|<R|kotlin/collections/Set<kotlin/String>|>(<L> = withValidityAssertion@fun <anonymous>(): R|kotlin/collections/Set<kotlin/String>| <inline=Inline, kind=UNKNOWN> {
|
||||
^ R|/buildSet|<R|kotlin/Any?|>(<L> = buildSet@fun R|kotlin/collections/MutableSet<kotlin/Any?>|.<anonymous>(): R|kotlin/Unit| <inline=Inline, kind=UNKNOWN> {
|
||||
this@R|/KtFirCompositeScope|.R|/KtFirCompositeScope.subScopes|.R|kotlin/collections/flatMapTo|<R|KtScope|, R|kotlin/String|, R|it(kotlin/Unit & kotlin/collections/MutableCollection<in kotlin/String>)|>(this@R|special/anonymous|, <L> = flatMapTo@fun <anonymous>(it: R|KtScope|): R|kotlin/collections/Iterable<kotlin/String>| <inline=Inline, kind=UNKNOWN> {
|
||||
^ R|<local>/it|.R|/KtScope.getAllNames|()
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
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() }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user