Your first code snippet was the right way to achie...
# announcements
v
Your first code snippet was the right way to achieve what you what. Lambda expressions don't introduce a new scope with
this
defined and in case you really want to access
this
, you have to use an object expression:
Copy code
object.addCallback(object : Callback {
  override fun callback() {
    object.removeCallback(this)
  }
})