Why the code in an object expression can access variables from the scope that contains it in kotlin?

后端 未结 5 1158
醉梦人生
醉梦人生 2021-01-01 10:49

In Kotlin,the code in an object expression can access variables from the scope that contains it, just like the following code:

fun countClicks(window: JCompo         


        
5条回答
  •  孤城傲影
    2021-01-01 11:52

    With Android Studio 3.2, this nice little message tells you whats going on with projectType var inside the closure.

提交回复
热议问题