[FIR] Change API for generating nested classes from plugins

`FirDeclarationGenerationExtension.generateClassLikeDeclaration` was split
  into two functions: one for generating top level classes, and one for
  nested classes. Such change reduces verbosity and error-proness of
  this extension and also allows to smoothly run plugins on local classes

^KT-55248 Fixed
This commit is contained in:
Dmitriy Novozhilov
2022-12-21 10:29:54 +02:00
committed by Space Team
parent faa96ec7c0
commit 6783621eb0
31 changed files with 458 additions and 162 deletions
@@ -0,0 +1,20 @@
// TARGET_BACKEND: JVM_IR
// WITH_STDLIB
import kotlinx.serialization.*
fun local(): String {
@Serializable
data class Carrier(val i: Int)
return Carrier.serializer().descriptor.toString()
}
fun box(): String {
val expected = "local.Carrier(i: kotlin.Int)"
val actual = local()
if (expected != actual) {
return "Fail: $actual"
}
return "OK"
}