refactoring of codegen contexts, and proper this/outer/super/receiver support

This commit is contained in:
Alex Tkachman
2011-11-08 11:11:42 +01:00
parent aa1ebbe445
commit 509ffb2fde
17 changed files with 523 additions and 379 deletions
@@ -0,0 +1,24 @@
class Request(val path: String) {
}
class Handler() {
fun Int.times(op: fun(): Unit) {
for(i in 0..this)
op()
}
// fun Request.getPath() : String {
// val sb = java.lang.StringBuilder()
// 10.times {
// sb.append(path)?.append(this)
// }
// return sb.toString() as String
// }
fun Request.getPath() = path
fun test(request: Request) = request.getPath()
}
fun box() : String = if(Handler().test(Request("239")) == "239") "OK" else "fail"