added test cases for KT-1619 and KT-1617
This commit is contained in:
@@ -0,0 +1,20 @@
|
|||||||
|
package regressions
|
||||||
|
|
||||||
|
// TODO comment out the next line to reproduce KT-1617
|
||||||
|
import kotlin.util.map
|
||||||
|
import kotlin.util.arrayList
|
||||||
|
|
||||||
|
import java.util.Collection
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
|
import junit.framework.TestCase
|
||||||
|
|
||||||
|
class Kt1617Test: TestCase() {
|
||||||
|
fun testMapFunction() {
|
||||||
|
val coll: Collection<String> = arrayList("foo", "bar")
|
||||||
|
|
||||||
|
val files = coll.map<String, File>{ File(it) }
|
||||||
|
|
||||||
|
println("Found files: $files")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package regressions
|
||||||
|
|
||||||
|
import junit.framework.TestCase
|
||||||
|
import java.util.List
|
||||||
|
import kotlin.util.arrayList
|
||||||
|
|
||||||
|
class Kt1619Test: TestCase() {
|
||||||
|
|
||||||
|
fun doSomething(list: List<String?>): Boolean {
|
||||||
|
return list.size() > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
fun testCollectionNotNullCanBeUsedForNullables() {
|
||||||
|
val list: List<String> = arrayList("foo", "bar")
|
||||||
|
// TODO uncomment this line to reproduce KT-1619
|
||||||
|
// doSomething(list)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user