Find anonymous object : Interface { override fun … } with a single override
ProprietaryAn anonymous object that implements one interface with a single function override is the canonical SAM-conversion target. If the interface is declared fun interface I { … }, the call site collapses to a lambda.
org. openrewrite. kotlin. bestpractices. FindAnonymousObjectSingleMethod$KtRecipemod run . --recipe= 'org. openrewrite. kotlin. bestpractices. FindAnonymousObjectSingleMethod$KtRecipe'Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.