https://kotlinlang.org logo
#detekt
Title
# detekt
v

vineethraj49

04/04/2021, 5:52 AM
hi, i'm trying to write a detekt extension; how do I know if a
KtLambdaExpression
is suspending in nature?
1
once you have a
org.jetbrains.kotlin.types.KotlinType
you can use the
org.jetbrains.kotlin.builtins.isSuspendFunctionTypeOrSubtype
extension on it
v

vineethraj49

04/04/2021, 6:18 AM
how do I get to a
KotlinType
from a
KtLambdaExpression
though? can you please provide a couple of pointers on that?
e

ephemient

04/04/2021, 6:19 AM
the page I linked to first links to examples in the detekt codebase
v

vineethraj49

04/04/2021, 11:17 AM
@ephemient, this worked, thanks