JET-140 Change function type syntax

and tests for
JET-168 Improve the parser for function and tuple types as receiver types
This commit is contained in:
Andrey Breslav
2011-07-06 17:49:35 +04:00
parent 4cf00a8548
commit e0d597a1bc
56 changed files with 279 additions and 1874 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ namespace jet121 {
return if (answer == 2) "OK" else "FAIL"
}
fun apply(arg:String, f : {String.() : Int}) : Int {
fun apply(arg:String, f : fun String.() : Int) : Int {
return arg.f()
}
}
+3 -3
View File
@@ -1,8 +1,8 @@
fun foo1() : {(Int) : Int}
fun foo1() : fun (Int) : Int
fun foo() {
val h : {(Int) : Int} = foo1();
val h : fun (Int) : Int = foo1();
h(1)
val m : {(Int) : Int} = {(a : Int) => 1}//foo1()
val m : fun (Int) : Int = {(a : Int) => 1}//foo1()
m(1)
}