Files
kotlin-fork/compiler/testData/codegen/regressions/kt707.kt
T
2013-01-24 21:12:27 +04:00

9 lines
236 B
Kotlin

class List<T>(val head: T, val tail: List<T>? = null)
fun <T> List<T>.mapHead(f: (T)-> T): List<T> = List<T>(f(head), null)
fun box() : String {
val a: Int = List<Int>(1).mapHead{it * 2}.head
System.out?.println(a)
return "OK"
}