Hi! Is there an idiomatic way to avoid writing boi...
# getting-started
v
Hi! Is there an idiomatic way to avoid writing boilerplate(IMHO) code like
if (predicate(some)) some else null
,
if (some is SomeClass) some else null
I wrote some extension functions, but have doubts about exceeding the level of insanity 🙂 : https://github.com/vkurdin/idea-php-lambda-folding/blob/master/src/ru/vkurdin/idea/php/lambdafolding/StandardExtensions.kt#L9-L11
letIs
helps with smart casts though Usage ex.: https://github.com/vkurdin/idea-php-lambda-folding/blob/master/src/ru/vkurdin/idea/php/lambdafolding/StandardCallableArgumentsTypeProvider.kt#L18-L42