[FIR] Support MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES

^KT-59408 Fixed
This commit is contained in:
Nikolay Lunyak
2023-07-17 14:50:12 +03:00
committed by Space Team
parent 9850987415
commit 61448531cb
21 changed files with 146 additions and 31 deletions
@@ -89,6 +89,14 @@ inline fun <reified T> List<*>.castAll(): List<@kotlin.internal.NoInfer T> {
return this as List<T>
}
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@UnsafeCastFunction
inline fun <reified T> Collection<*>.castAll(): Collection<@kotlin.internal.NoInfer T> {
for (element in this) element as T
@Suppress("UNCHECKED_CAST")
return this as Collection<T>
}
fun <T> sequenceOfLazyValues(vararg elements: () -> T): Sequence<T> = elements.asSequence().map { it() }
fun <T1, T2> Pair<T1, T2>.swap(): Pair<T2, T1> = Pair(second, first)