Code clean, small refactorings and tests

#KT-8987 Fixed
This commit is contained in:
Michael Bogdanov
2015-10-01 12:15:05 +03:00
parent 3806ad65fc
commit cd78514b76
26 changed files with 451 additions and 143 deletions
+13
View File
@@ -0,0 +1,13 @@
var invokeOrder: String = ""
fun test(x: Double = { invokeOrder += "x"; 1.0 }(), a: String, y: Long = { invokeOrder += "y"; 1 }(), b: String): String {
return "" + x + a + b + y;
}
fun box(): String {
val funResult = test(b = { invokeOrder += "K"; "K" }(), a = { invokeOrder += "O"; "O" }())
if (invokeOrder != "KOxy" || funResult != "1.0OK1") return "fail: $invokeOrder != KOxy or $funResult != 1.0OK1"
return "OK"
}