-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JVM] Fix backing field visibility in
LateinitLowering
^KT-71141
- Loading branch information
1 parent
17aa734
commit 455b127
Showing
3 changed files
with
127 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...er/ir/backend.jvm/lower/src/org/jetbrains/kotlin/backend/jvm/lower/JvmLateinitLowering.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors. | ||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. | ||
*/ | ||
|
||
package org.jetbrains.kotlin.backend.jvm.lower | ||
|
||
import org.jetbrains.kotlin.backend.common.CommonBackendContext | ||
import org.jetbrains.kotlin.backend.common.lower.LateinitLowering | ||
import org.jetbrains.kotlin.backend.common.phaser.PhaseDescription | ||
import org.jetbrains.kotlin.ir.declarations.IrField | ||
import org.jetbrains.kotlin.ir.declarations.IrProperty | ||
|
||
@PhaseDescription(name = "JvmLateinitLowering") | ||
class JvmLateinitLowering(context: CommonBackendContext) : LateinitLowering(context) { | ||
override fun transformLateinitBackingField(backingField: IrField, property: IrProperty) { | ||
super.transformLateinitBackingField(backingField, property) | ||
backingField.visibility = property.setter?.visibility ?: property.visibility | ||
} | ||
} |