IR: make lateinit lowering traverse local classes
This commit is contained in:
+8
@@ -36,6 +36,10 @@ import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid
|
||||
|
||||
class NullableFieldsForLateinitCreationLowering(val backendContext: CommonBackendContext) : DeclarationTransformer {
|
||||
|
||||
override fun lower(irFile: IrFile) {
|
||||
runPostfix(true).toFileLoweringPass().lower(irFile)
|
||||
}
|
||||
|
||||
override fun transformFlat(declaration: IrDeclaration): List<IrDeclaration>? {
|
||||
if (declaration is IrField) {
|
||||
declaration.correspondingPropertySymbol?.owner?.let { property ->
|
||||
@@ -52,6 +56,10 @@ class NullableFieldsForLateinitCreationLowering(val backendContext: CommonBacken
|
||||
// Transform declarations
|
||||
class NullableFieldsDeclarationLowering(val backendContext: CommonBackendContext) : DeclarationTransformer {
|
||||
|
||||
override fun lower(irFile: IrFile) {
|
||||
runPostfix(true).toFileLoweringPass().lower(irFile)
|
||||
}
|
||||
|
||||
override fun transformFlat(declaration: IrDeclaration): List<IrDeclaration>? {
|
||||
when (declaration) {
|
||||
is IrProperty -> {
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// IGNORE_BACKEND: JVM_IR, JS_IR
|
||||
|
||||
import kotlin.UninitializedPropertyAccessException
|
||||
|
||||
|
||||
Reference in New Issue
Block a user