我正在try Kotlin,希望为Activity实现一个惰性扩展属性:
/**
* Activity module
*/
val Activity.activityModule: ActivityModule by lazy {
ActivityModule(this)
}
The compiler errors with:
'this' is not defined in this context
我怎样才能将此活动定义为此活动?我读了a guide本,但没读到.this@Activity
号表示,该参考资料尚未解决.