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

Marcelo Hernandez

09/24/2020, 6:47 PM
Hello. I am trying to resolve the return type of a function that returns a
Flow<T>
(including subclasses) in
visitNamedFunction
. I am new to the APIs in
kotlin-compiler-embeddable
. I am trying to use:
Copy code
bindingContext[BindingContext.FUNCTION, function].returnType
but that seems to resolve to an
UnresolvedType
. I have also tried
Copy code
function.getResolvedCall(bindingContext)
but that always returns
null
. Is there any way to resolve types that are not considered built-in?
Think I figured out why the Kotlinx Coroutine types are resolving to
UnresolvedType
. This is happening when I run the Spek tests. If I add a resolved path to the
kotlinx-coroutines-core
jar in KtTestCompiler, my rule, when run in test environment, succeed in resolving
Flow
.
2 Views