Johann Pardanaud
05/09/2023, 12:00 PMNorbi
05/09/2023, 12:06 PMAlejandro Serrano Mena
05/09/2023, 12:07 PMcompanion object
themselfNorbi
05/09/2023, 12:08 PMRyan Brink
05/09/2023, 1:16 PMclass Potato {
companion object
}
// Generate w/ KSP
fun Potato.Companion.b() = 2
fun main() {
println(Potato.b())
}
Johann Pardanaud
05/09/2023, 1:29 PMAlex Vanyo
05/09/2023, 2:25 PMJohann Pardanaud
05/09/2023, 2:27 PMNorbi
05/09/2023, 8:03 PMHow does the codegen work?This is the case when you need a compiler plugin 🙂 (Because KSP can generate only new classes and resource, modifying an existing class is possible only by using compiler plugins.)