[FIR-TEST] Add new testdata generated after changes in previous commit
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
fun test1() {
|
||||
if (true) {
|
||||
when (true) {
|
||||
true -> println()
|
||||
}
|
||||
} else {
|
||||
System.out?.println() // kotlin.Unit?
|
||||
}
|
||||
}
|
||||
|
||||
fun test2() {
|
||||
val mlist = arrayListOf("")
|
||||
if (true) {
|
||||
when (true) {
|
||||
true -> println()
|
||||
}
|
||||
} else {
|
||||
mlist.add("") // kotlin.Boolean
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import java.util.*
|
||||
import kotlin.comparisons.compareBy
|
||||
import kotlin.comparisons.nullsLast
|
||||
|
||||
class Foo(val a: String, val b: Int)
|
||||
|
||||
fun getComp(): Comparator<Foo?> =
|
||||
when {
|
||||
else -> nullsLast(compareBy({ it.<!UNRESOLVED_REFERENCE!>a<!> }, { it.<!UNRESOLVED_REFERENCE!>b<!> }))
|
||||
}
|
||||
|
||||
fun getCompInverted(): Comparator<Foo?> =
|
||||
nullsLast(
|
||||
when {
|
||||
else -> compareBy({ it.<!UNRESOLVED_REFERENCE!>a<!> }, { it.<!UNRESOLVED_REFERENCE!>b<!> })
|
||||
}
|
||||
)
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
|
||||
import java.util.*
|
||||
|
||||
fun <T> nullable(x: T): T? = x
|
||||
|
||||
@Suppress("UNUSED_PARAMETER")
|
||||
fun <T> select(x1: T, x2: T): T = x1
|
||||
|
||||
val test1 =
|
||||
listOf(1, 2, 3).mapNotNullTo(ArrayList()) {
|
||||
if (true) nullable(it) else null
|
||||
}
|
||||
|
||||
val test2: MutableList<Int?> =
|
||||
listOf(1, 2, 3).mapNotNullTo(ArrayList()) {
|
||||
if (true) nullable(it) else null
|
||||
}
|
||||
|
||||
val test3: MutableList<Int> =
|
||||
listOf(1, 2, 3).mapNotNullTo(ArrayList()) {
|
||||
if (true) nullable(it) else null
|
||||
}
|
||||
|
||||
val test4: Collection<Int> =
|
||||
listOf(1, 2, 3).flatMapTo(LinkedHashSet()) {
|
||||
listOf(it)
|
||||
}
|
||||
|
||||
val test5: Collection<Int> =
|
||||
listOf(1, 2, 3).flatMapTo(LinkedHashSet()) { // TODO
|
||||
if (true) listOf(it) else listOf(it)
|
||||
}
|
||||
|
||||
val test6: Collection<Int> =
|
||||
listOf(1, 2, 3).flatMapTo(LinkedHashSet<Int>()) {
|
||||
if (true) listOf(it) else listOf(it)
|
||||
}
|
||||
|
||||
val test7: Collection<Int> =
|
||||
listOf(1, 2, 3).flatMapTo(LinkedHashSet()) {
|
||||
select(listOf(it), listOf(it))
|
||||
}
|
||||
Reference in New Issue
Block a user