Files
kotlin-fork/backend.native/tests/codegen/function/defaults2.kt
T
Vasily Levchenko a8caf7c7d8 TEST: test for default parameters
(cherry picked from commit 7999d68d812aedd5863f04b7fd2171e284b8f332)
2017-01-13 13:42:02 +03:00

11 lines
206 B
Kotlin

fun Int.foo(inc0:Int, inc:Int = 0) = this + inc0 + inc
fun main(arg:Array<String>) {
val v = 42.foo(0)
if (v != 42) {
println("test failed v:$v expected:42")
throw Error()
}
}