'this' is resolved to the corresponding declaration in labeled function literals

This commit is contained in:
Andrey Breslav
2011-05-30 16:02:51 +04:00
parent 2052683de3
commit a676c960cf
10 changed files with 105 additions and 29 deletions
+19
View File
@@ -20,3 +20,22 @@ fun foo() : Unit {
<error>this</error>
this<error>@a</error>
}
namespace closures {
class A(val a:Int) {
class B() {
val x = this@B : B
val y = this@A : A
val z = this : B
val Int.xx = this : Int
fun Char.xx() {
this : Char
val a = {Double.() => this : Double + this@xx : Char}
val b = @a{Double.() => this@a : Double + this@xx : Char}
val c = @a{() => <error>this@a</error> + this@xx : Char}
return (@a{Double.() => this@a : Double + this@xx : Char})
}
}
}
}