Is there a way to get the return type of a generic...
# ksp
j
Is there a way to get the return type of a generic constructor in ksp2 that preserves the type parameters? I have a class like this:
Copy code
sealed class KonvertResult<out T, out E> {
  data class Ok<out T>(val value: T) : KonvertResult<T, Nothing>()
  data class Err<out E>(val error: E) : KonvertResult<Nothing, E>()
}
I'm getting a reference to it's constructor in ksp like this:
Copy code
private val okConstructor = resolver
    .getClassDeclarationByName<KonvertResult.Ok<*>>()
    ?.getConstructors()
    ?.firstOrNull()
In ksp1 when I run
okConstructor.returnType
I get
Ok<T>
. But in ksp2 when I return
okConstructor.returnType
I get
Ok<*>
. Is there any way I can get back to
Ok<T>
?