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
@@ -1,4 +1,4 @@
namespace example;
package example;
fun any(<!UNUSED_PARAMETER!>a<!> : Any) {}
@@ -7,7 +7,7 @@ fun notAnExpression() {
if (<!SUPER_IS_NOT_AN_EXPRESSION!>super<!>) {} else {} // not an expression
val <!UNUSED_VARIABLE!>x<!> = <!SUPER_IS_NOT_AN_EXPRESSION!>super<!> // not an expression
when (1) {
<!SUPER_IS_NOT_AN_EXPRESSION!>super<!> => 1 // not an expression
<!SUPER_IS_NOT_AN_EXPRESSION!>super<!> -> 1 // not an expression
}
}
@@ -33,8 +33,8 @@ class A<E>() : C(), T {
super<<!NOT_A_SUPERTYPE!>E<!>>@A.bar()
super<<!NOT_A_SUPERTYPE!>Int<!>>.foo()
super<<!SYNTAX!><!>>.foo()
super<<!NOT_A_SUPERTYPE!>fun() : Unit<!>>.foo()
super<<!NOT_A_SUPERTYPE!>()<!>>.foo()
super<<!NOT_A_SUPERTYPE!>() -> Unit<!>>.foo()
super<<!NOT_A_SUPERTYPE!>#()<!>>.foo()
super<T><!UNRESOLVED_REFERENCE!>@B<!>.foo()
super<C><!UNRESOLVED_REFERENCE!>@B<!>.bar()
}