this
this
this关键字可以作用到类,函数,lambda表达式
class A {
inner
class B {
fun Int.foo() {
val a =
this@A
val b =
this@B
val c =
this
val c1 =
this@foo
val funLit =
@lambda {String.() ->
val d =
this
val d1 =
this@lambda
}
val funLit2 = { (s: String) ->
val d1 =
this
}
}
}
}