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,6 +1,6 @@
//KT-510 `this.` allows initialization without backing field
namespace kt510
package kt510
public open class Identifier1() {
var field : Boolean
@@ -1,6 +1,6 @@
//KT-607 Val reassignment is not marked as an error
namespace kt607
package kt607
fun foo(a: A) {
val o = object {
@@ -1,6 +1,6 @@
//KT-609 Analyze not only local variables, but function parameters as well in 'unused values' analysis
namespace kt609
package kt609
fun test(var a: Int) {
a = <!UNUSED_VALUE!>324<!> //should be an 'unused value' warning here
@@ -1,6 +1,6 @@
//KT-610 Distinguish errors 'unused variable' and 'variable is assigned but never accessed'
namespace kt610
package kt610
fun foo() {
var <!UNUSED_VARIABLE!>j<!> = 9 //'unused variable' error
@@ -1,6 +1,6 @@
//KT-843 Don't highlight incomplete variables as unused
namespace kt843
package kt843
fun main(args : Array<String>) {
// Integer type