let 源码
@kotlin.internal.InlineOnly
public inline fun <T, R> T.let(block: (T) -> R): R {
contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
}
return block(this)
}
(T) -> R
传入T返回R
(T) 代表对本身的一个应用
也是it 关键字的所在
T.() 就对应this了