is there a good doc somewhere for how to override ...
# compiler
z
is there a good doc somewhere for how to override generic functions in FIR? Digging around in FIR sources, the class to use to handle substitutions is
ConeSubstitutor
, but I'm not able to grok from sources alone how it should be used. Mostly trying to handle this case where I want to materialize the generic in the context of a subtype
Copy code
interface Base<T> {
  fun example(): T
}

abstract class BaseImpl : Base<String>

// Want to generate
abstract class GeneratedBaseImpl : BaseImpl {
  override fun example(): String
}
b
While it's not documentation, Kotlin Serialization does this for generic overrides: https://github.com/JetBrains/kotlin/blob/68f050338875bd9ee1f8e754163949fb2f49f732/[…]/serialization/compiler/fir/SerializationFirResolveExtension.kt. This may serve as a good example for your use case, but probably not a good example for
ConeSubstitutor
.
🙇 1