Files
kotlin-fork/backend.native/tests/external/codegen/blackbox/regressions/kt1406.kt
T
Ilya Matveev 1b553ebfaf backend/tests: Add blackbox tests from Kotlin JVM
Added tests from testData/codegen/box directory. There are blackbox tests
in other directories and they are to be added.
2017-01-20 14:04:04 +03:00

30 lines
494 B
Kotlin

// TARGET_BACKEND: JVM
// WITH_RUNTIME
// FULL_JDK
package pack
import java.util.regex.Pattern
class C{
public fun foo(){
val items : Collection<Item> = listOf(Item())
val result = ArrayList<Item>()
val pattern: Pattern? = Pattern.compile("...")
items.filterTo(result) {
pattern!!.matcher(it.name())!!.matches()
}
}
private fun Item.name() : String = ""
}
class Item{
}
fun box() : String {
C().foo()
return "OK"
}