我已阅读thisquestion但我对crossinline关键字有一个更基本的问题。我不太确定它正在解决什么问题以及它是如何解决的。来自theKotlinDocs,Notethatsomeinlinefunctionsmaycallthelambdaspassedtothemasparametersnotdirectlyfromthefunctionbody,butfromanotherexecutioncontext,suchasalocalobjectoranestedfunction.Insuchcases,non-localcontrolflowisalsonotallowe