[Tests] Trim contents before checking for FIR_IDENTICAL

This commit is contained in:
Kirill Rakhman
2023-09-05 17:02:39 +02:00
committed by Space Team
parent 6b919e2593
commit 10e94f90ac
11 changed files with 7 additions and 91 deletions
@@ -1,8 +0,0 @@
fun <T> Array<out T>.intersect(other: Iterable<T>) {
val set = toMutableSet()
set.retainAll(other)
}
fun <X> Array<out X>.toMutableSet(): MutableSet<X> = TODO()
fun <Y> MutableCollection<in Y>.retainAll(elements: Iterable<Y>) {}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
fun <T> Array<out T>.intersect(other: Iterable<T>) {
val set = toMutableSet()
set.retainAll(other)
@@ -1,15 +0,0 @@
// completion order here: X, Y, WHEN_VARIABLE
fun <T> List<T>.optimizeReadOnlyList() = when (size) {
0 -> emptyList() // here type variable Y will be fixed to Nothing
1 -> listOf(this[0])
else -> this
}
fun <X> listOf(element: X): List<X> = TODO()
fun <Y> emptyList(): List<Y> = TODO()
fun test(l: List<String>): List<String> {
val foo = l.optimizeReadOnlyList()
return foo
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// completion order here: X, Y, WHEN_VARIABLE
fun <T> List<T>.optimizeReadOnlyList() = when (size) {
0 -> emptyList() // here type variable Y will be fixed to Nothing