https://kotlinlang.org logo
Title
r

Rohil Chodankar

12/14/2021, 11:25 AM
Hi everyone, I am currently actively working to migrate from
KAPT
to
KSP
in our android project. We have one internal processor that generates an extension function to convert a String into respective class type. Code snippet below. Everything works well and
ksp
generates the class. The problem I am facing is that some classes have companion object function that try to access the generated function. The IDE fails to resolve the generated function (although i have marked the generated path as explained) and intermittently the build task fails.
@MyAnnotation
enum class Test {
  @Field(name = "value1") value1,
  @Field(name = "value2") value2,

  companion object {
    fun fromString(value: String?): Test? = value?.toTest()
  }
}
I think i found the solution it was related to https://kotlinlang.slack.com/archives/C013BA8EQSE/p1635931295085600
👍 1