Is it possible to tell kotlin compiler to avoid ge...
# compiler
s
Is it possible to tell kotlin compiler to avoid generating deprecated methods like this:
Copy code
@kotlin.Deprecated public constructor
in the
class
file?
r
Not sure if externally it’s possible with some compiler flag but if it isn’t it’s possible with a compiler plugin. It could intercept the IR or codegen phase scanning for those and emitting diagnostics if it finds them or completely remove them from the tree all together.
If you go down the path of IR and compiler plugins it may look something like this to get to those constructors https://github.com/arrow-kt/arrow-meta/blob/e347e266e8b337821de16b960babbea1d6247c50/compiler-plugin/src/main/kotlin/arrow/meta/dsl/codegen/ir/IrSyntax.kt#L178-L184