TEST: test for default parameters

(cherry picked from commit 7999d68d812aedd5863f04b7fd2171e284b8f332)
This commit is contained in:
Vasily Levchenko
2016-12-26 18:02:32 +03:00
committed by vvlevchenko
parent b994fabadd
commit a8caf7c7d8
6 changed files with 155 additions and 0 deletions
@@ -0,0 +1,10 @@
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()
}
}