Cannot remove callback in Android looper

When I post an lambda in Android, kotlin compiler automatically convert lambda to runnable by create a new Runnable object to wrap that lambda.
Then when I want to remove this callback, kotlin will create another new Runnable object to wrap my lambda.
Hence the removement won’t success.

val task = {  }
// kotlin automatically convert task to Runnable { task() }
MainLooper.post(task)
// cannot remove this callback because
// Runnable { task() } is not the same one
MainLooper.removeCallbacks(task) 

I know the correct way to write this. But why kotlin compiler make this dangerous conversion?

val task = Runnable {  } // SAM conversion
MainLooper.post(task)
MainLooper.removeCallbacks(task) // successfully removed

Indeed it seems like the compiler should be able to do a better job in this trivial case. But there will be other cases that are less trivial and some in which the compiler is not smart enough. We will end up in a situation where some cases work and others do not work. Maybe it is better if none of them work.