42 lines
806 B
Plaintext
42 lines
806 B
Plaintext
class Dup {
|
|
fun Dup() : Unit {
|
|
this<error>@Dup</error>
|
|
}
|
|
}
|
|
|
|
class A() {
|
|
fun foo() : Unit {
|
|
this@A
|
|
this<error>@a</error>
|
|
this
|
|
}
|
|
|
|
val x = this@A.foo()
|
|
val y = this.foo()
|
|
val z = foo()
|
|
}
|
|
|
|
fun foo1() : 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() : Any {
|
|
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})
|
|
}
|
|
}
|
|
}
|
|
}
|