While developing compiler plugin I've faced with p...
# compiler
p
While developing compiler plugin I've faced with problem that I can't solve without help. In IrGenerationExtension while visiting class I need to check if it is subclass or same class of one taken from pluginContext::referenceClass.
Copy code
override fun visitClass(declaration: IrClass): IrStatement {
    val exampleClass = pluginContext.referenceClass(ClassId.topLevel(FqName("pack.Example")))!!
    if (declaration.isSubclassOf(exampleClass.owner)) { ... }
}
This was working fine until I apply Compose plugin. After that declaration.isSubclassOf(exampleClass.owner) starts always return false for cases when it should return true. I can't figure out how to fix. Please help. Repro is here: https://github.com/hondogo/CustomKotlinCompilerPluginFailureRepro/blob/main/plugin/src/main/kotlin/pack/ExamplePluginRegistrar.kt#L39