Tests: fix stdlib declarations in IR interpreter test data

Fix some unresolved supertypes. This is necessary to be able to enable
IR fake override builder by default (KT-61514), because it traverses all
supertypes and asserts that they're classes, so that it can build fake
overrides for declarations from there. Without this change, for example
`IrFakeOverrideBuilder.buildFakeOverridesForClass` would crash.
This commit is contained in:
Alexander Udalov
2024-02-12 12:43:49 +01:00
committed by Space Team
parent 10dbe73828
commit cf425ffded
10 changed files with 85 additions and 9 deletions
+6 -1
View File
@@ -19,6 +19,11 @@ private object EmptySequence : Sequence<Nothing>, DropTakeSequence<Nothing> {
override fun take(n: Int) = EmptySequence
}
internal interface DropTakeSequence<T> : Sequence<T> {
fun drop(n: Int): Sequence<T>
fun take(n: Int): Sequence<T>
}
public inline fun <T> Sequence<T>?.orEmpty(): Sequence<T> = this ?: emptySequence()
private class GeneratorSequence<T : Any>(private val getInitialValue: () -> T?, private val getNextValue: (T) -> T?) : Sequence<T> {
@@ -119,4 +124,4 @@ private fun <T> Appendable.appendElement(element: T, transform: ((T) -> CharSequ
element is Char -> append(element)
else -> append(element.toString())
}
}
}