Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolveWithStdlib/noneWithForEach.kt
T
2023-05-19 11:50:40 +00:00

23 lines
495 B
Kotlin
Vendored

// IGNORE_DIAGNOSTIC_API
// IGNORE_REVERSED_RESOLVE
// Ignore reason: KT-58786
interface Diagnostic {
val name: String
}
fun foo(conflicting: List<Diagnostic>) {
val filtered = arrayListOf<Diagnostic>()
conflicting.groupBy {
it.name
}.forEach {
val diagnostics = it.value
filtered.addAll(
diagnostics.filter { me ->
diagnostics.none { other ->
me != other
}
}
)
}
}