Minor, move IrClass.primaryConstructor to 'ir.tree'
This commit is contained in:
@@ -395,9 +395,6 @@ fun IrClass.simpleFunctions() = declarations.flatMap {
|
||||
}
|
||||
}
|
||||
|
||||
val IrClass.primaryConstructor: IrConstructor?
|
||||
get() = constructors.singleOrNull(IrConstructor::isPrimary)
|
||||
|
||||
fun IrClass.createParameterDeclarations() {
|
||||
assert (thisReceiver == null)
|
||||
|
||||
|
||||
+1
-2
@@ -8,7 +8,6 @@ package org.jetbrains.kotlin.backend.jvm.lower
|
||||
import org.jetbrains.kotlin.backend.common.FileLoweringPass
|
||||
import org.jetbrains.kotlin.backend.common.ir.copyParameterDeclarationsFrom
|
||||
import org.jetbrains.kotlin.backend.common.ir.passTypeArgumentsFrom
|
||||
import org.jetbrains.kotlin.backend.common.ir.primaryConstructor
|
||||
import org.jetbrains.kotlin.backend.common.lower.createIrBuilder
|
||||
import org.jetbrains.kotlin.backend.common.lower.irBlockBody
|
||||
import org.jetbrains.kotlin.backend.common.phaser.makeIrFilePhase
|
||||
@@ -324,7 +323,7 @@ private class JvmInlineClassLowering(private val context: JvmBackendContext) : F
|
||||
|
||||
private fun buildPrimaryInlineClassConstructor(irClass: IrClass, irConstructor: IrConstructor) {
|
||||
// Add the default primary constructor
|
||||
val primaryConstructor = irClass.addConstructor {
|
||||
irClass.addConstructor {
|
||||
updateFrom(irConstructor)
|
||||
visibility = Visibilities.PRIVATE
|
||||
origin = JvmLoweredDeclarationOrigin.SYNTHETIC_INLINE_CLASS_MEMBER
|
||||
|
||||
-1
@@ -5,7 +5,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.backend.jvm.lower.inlineclasses
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.ir.primaryConstructor
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.erasedUpperBound
|
||||
import org.jetbrains.kotlin.codegen.state.md5base64
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
|
||||
@@ -189,6 +189,9 @@ val IrClassSymbol.constructors: Sequence<IrConstructorSymbol>
|
||||
val IrClass.constructors: Sequence<IrConstructor>
|
||||
get() = this.declarations.asSequence().filterIsInstance<IrConstructor>()
|
||||
|
||||
val IrClass.primaryConstructor: IrConstructor?
|
||||
get() = this.declarations.singleOrNull { it is IrConstructor && it.isPrimary } as IrConstructor?
|
||||
|
||||
val IrDeclarationContainer.properties: Sequence<IrProperty>
|
||||
get() = declarations.asSequence().filterIsInstance<IrProperty>()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user