[FIR] Fix reporting of UNINITIALIZED_ENUM_ENTRY in init blocks

^KT-41126 Fixed
This commit is contained in:
Dmitriy Novozhilov
2023-02-07 14:17:10 +02:00
committed by Space Team
parent c596c1ad73
commit a9248569a6
17 changed files with 135 additions and 110 deletions
@@ -292,6 +292,16 @@ inline fun <T, U, K, V> List<T>.flatGroupBy(
return result
}
inline fun <T, K> List<T>.flatAssociateBy(selector: (T) -> Collection<K>): Map<K, T> {
return buildMap {
for (value in this@flatAssociateBy) {
for (key in selector(value)) {
put(key, value)
}
}
}
}
fun <E> MutableList<E>.popLast(): E = removeAt(lastIndex)
fun <K : Enum<K>, V> enumMapOf(vararg pairs: Pair<K, V>): EnumMap<K, V> = EnumMap(mapOf(*pairs))