GreatSyntacticShift: Syntax for function types, function literals, when and tuples

Bug:
fun loop(var times : Int) {
   while(times > 0) {
        val u : (value : Int) -> Unit = { // This arrow is confusing the lookahead
            System.out?.println(it)
        }
        u(times--)
   }
}
This commit is contained in:
Andrey Breslav
2011-12-20 22:55:25 +04:00
parent c9959a10f9
commit 41fd43b5e5
124 changed files with 1602 additions and 758 deletions
@@ -21,7 +21,7 @@ fun foo1() : Unit {
this<!UNRESOLVED_REFERENCE!>@a<!>
}
namespace closures {
package closures {
class A(val a:Int) {
class B() {
@@ -31,10 +31,10 @@ namespace closures {
val Int.xx = this : Int
fun Char.xx() : Any {
this : Char
val <!UNUSED_VARIABLE!>a<!> = {Double.() => this : Double + this@xx : Char}
val <!UNUSED_VARIABLE!>b<!> = @a{Double.() => this@a : Double + this@xx : Char}
val <!UNUSED_VARIABLE!>c<!> = @a{() => <!NO_THIS!>this@a<!> + this@xx : Char}
return (@a{Double.() => this@a : Double + this@xx : Char})
val <!UNUSED_VARIABLE!>a<!> = {Double.() -> this : Double + this@xx : Char}
val <!UNUSED_VARIABLE!>b<!> = @a{Double.() -> this@a : Double + this@xx : Char}
val <!UNUSED_VARIABLE!>c<!> = @a{() -> <!NO_THIS!>this@a<!> + this@xx : Char}
return (@a{Double.() -> this@a : Double + this@xx : Char})
}
}
}