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:
@@ -1,10 +1,10 @@
|
||||
fun text() {
|
||||
"direct:a" to "mock:a"
|
||||
"direct:a" on {it.body == "<hello/>"} to "mock:a"
|
||||
"direct:a" on {it => it.body == "<hello/>"} to "mock:a"
|
||||
"direct:a" on {it -> it.body == "<hello/>"} to "mock:a"
|
||||
bar <!TYPE_MISMATCH!>{1}<!>
|
||||
bar <!TYPE_MISMATCH!>{<!UNRESOLVED_REFERENCE!>it<!> + 1}<!>
|
||||
bar {it, it1 => it}
|
||||
bar {it, it1 -> it}
|
||||
|
||||
bar1 {1}
|
||||
bar1 {it + 1}
|
||||
@@ -12,18 +12,18 @@ fun text() {
|
||||
bar2 <!TYPE_MISMATCH!>{<!TYPE_MISMATCH!><!>}<!>
|
||||
bar2 {1}
|
||||
bar2 {<!UNRESOLVED_REFERENCE!>it<!>}
|
||||
bar2 <!TYPE_MISMATCH!>{<!CANNOT_INFER_PARAMETER_TYPE!>it<!> => it}<!>
|
||||
bar2 <!TYPE_MISMATCH!>{<!CANNOT_INFER_PARAMETER_TYPE!>it<!> -> it}<!>
|
||||
}
|
||||
|
||||
fun bar(<!UNUSED_PARAMETER!>f<!> : fun (Int, Int) : Int) {}
|
||||
fun bar1(<!UNUSED_PARAMETER!>f<!> : fun (Int) : Int) {}
|
||||
fun bar2(<!UNUSED_PARAMETER!>f<!> : fun () : Int) {}
|
||||
fun bar(<!UNUSED_PARAMETER!>f<!> : (Int, Int) -> Int) {}
|
||||
fun bar1(<!UNUSED_PARAMETER!>f<!> : (Int) -> Int) {}
|
||||
fun bar2(<!UNUSED_PARAMETER!>f<!> : () -> Int) {}
|
||||
|
||||
fun String.to(<!UNUSED_PARAMETER!>dest<!> : String) {
|
||||
|
||||
}
|
||||
|
||||
fun String.on(<!UNUSED_PARAMETER!>predicate<!> : fun (s : URI) : Boolean) : URI {
|
||||
fun String.on(<!UNUSED_PARAMETER!>predicate<!> : (s : URI) -> Boolean) : URI {
|
||||
return URI(this)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user