IR: isExpect
This commit is contained in:
+7
-2
@@ -5,7 +5,12 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.backend.common.ir
|
package org.jetbrains.kotlin.backend.common.ir
|
||||||
|
|
||||||
import org.jetbrains.kotlin.descriptors.MemberDescriptor
|
import org.jetbrains.kotlin.ir.declarations.IrClass
|
||||||
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
|
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
|
||||||
|
import org.jetbrains.kotlin.ir.declarations.IrFunction
|
||||||
|
import org.jetbrains.kotlin.ir.declarations.IrProperty
|
||||||
|
|
||||||
val IrDeclaration.isExpect get() = descriptor.let { it is MemberDescriptor && it.isExpect }
|
val IrDeclaration.isExpect
|
||||||
|
get() = this is IrClass && isExpect ||
|
||||||
|
this is IrFunction && isExpect ||
|
||||||
|
this is IrProperty && isExpect
|
||||||
+2
@@ -18,6 +18,7 @@ class IrClassBuilder : IrDeclarationBuilder() {
|
|||||||
var isData: Boolean = false
|
var isData: Boolean = false
|
||||||
var isExternal: Boolean = false
|
var isExternal: Boolean = false
|
||||||
var isInline: Boolean = false
|
var isInline: Boolean = false
|
||||||
|
var isExpect: Boolean = false
|
||||||
|
|
||||||
fun updateFrom(from: IrClass) {
|
fun updateFrom(from: IrClass) {
|
||||||
super.updateFrom(from)
|
super.updateFrom(from)
|
||||||
@@ -29,5 +30,6 @@ class IrClassBuilder : IrDeclarationBuilder() {
|
|||||||
isData = from.isData
|
isData = from.isData
|
||||||
isExternal = from.isExternal
|
isExternal = from.isExternal
|
||||||
isInline = from.isInline
|
isInline = from.isInline
|
||||||
|
isExpect = from.isExpect
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -22,6 +22,7 @@ class IrFunctionBuilder : IrDeclarationBuilder() {
|
|||||||
var modality: Modality = Modality.FINAL
|
var modality: Modality = Modality.FINAL
|
||||||
var isTailrec: Boolean = false
|
var isTailrec: Boolean = false
|
||||||
var isSuspend: Boolean = false
|
var isSuspend: Boolean = false
|
||||||
|
var isExpect: Boolean = false
|
||||||
|
|
||||||
var isPrimary: Boolean = false
|
var isPrimary: Boolean = false
|
||||||
|
|
||||||
@@ -30,6 +31,7 @@ class IrFunctionBuilder : IrDeclarationBuilder() {
|
|||||||
|
|
||||||
isInline = from.isInline
|
isInline = from.isInline
|
||||||
isExternal = from.isExternal
|
isExternal = from.isExternal
|
||||||
|
isExpect = from.isExpect
|
||||||
|
|
||||||
if (from is IrSimpleFunction) {
|
if (from is IrSimpleFunction) {
|
||||||
modality = from.modality
|
modality = from.modality
|
||||||
|
|||||||
+1
@@ -15,4 +15,5 @@ class IrPropertyBuilder : IrDeclarationBuilder() {
|
|||||||
var isLateinit: Boolean = false
|
var isLateinit: Boolean = false
|
||||||
var isDelegated: Boolean = false
|
var isDelegated: Boolean = false
|
||||||
var isExternal: Boolean = false
|
var isExternal: Boolean = false
|
||||||
|
var isExpect: Boolean = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ interface IrClass :
|
|||||||
val isData: Boolean
|
val isData: Boolean
|
||||||
val isExternal: Boolean
|
val isExternal: Boolean
|
||||||
val isInline: Boolean
|
val isInline: Boolean
|
||||||
|
val isExpect: Boolean
|
||||||
|
|
||||||
val superTypes: MutableList<IrType>
|
val superTypes: MutableList<IrType>
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ interface IrFunction :
|
|||||||
|
|
||||||
val isInline: Boolean // NB: there's an inline constructor for Array and each primitive array class
|
val isInline: Boolean // NB: there's an inline constructor for Array and each primitive array class
|
||||||
val isExternal: Boolean
|
val isExternal: Boolean
|
||||||
|
val isExpect: Boolean
|
||||||
|
|
||||||
var returnType: IrType
|
var returnType: IrType
|
||||||
|
|
||||||
var dispatchReceiverParameter: IrValueParameter?
|
var dispatchReceiverParameter: IrValueParameter?
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ interface IrProperty :
|
|||||||
val isLateinit: Boolean
|
val isLateinit: Boolean
|
||||||
val isDelegated: Boolean
|
val isDelegated: Boolean
|
||||||
val isExternal: Boolean
|
val isExternal: Boolean
|
||||||
|
val isExpect: Boolean
|
||||||
|
|
||||||
var backingField: IrField?
|
var backingField: IrField?
|
||||||
var getter: IrSimpleFunction?
|
var getter: IrSimpleFunction?
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ class IrClassImpl(
|
|||||||
override val isInner: Boolean,
|
override val isInner: Boolean,
|
||||||
override val isData: Boolean,
|
override val isData: Boolean,
|
||||||
override val isExternal: Boolean,
|
override val isExternal: Boolean,
|
||||||
override val isInline: Boolean
|
override val isInline: Boolean,
|
||||||
|
override val isExpect: Boolean
|
||||||
) :
|
) :
|
||||||
IrDeclarationBase(startOffset, endOffset, origin),
|
IrDeclarationBase(startOffset, endOffset, origin),
|
||||||
IrClass {
|
IrClass {
|
||||||
@@ -64,7 +65,8 @@ class IrClassImpl(
|
|||||||
isInner = symbol.descriptor.isInner,
|
isInner = symbol.descriptor.isInner,
|
||||||
isData = symbol.descriptor.isData,
|
isData = symbol.descriptor.isData,
|
||||||
isExternal = symbol.descriptor.isEffectivelyExternal(),
|
isExternal = symbol.descriptor.isEffectivelyExternal(),
|
||||||
isInline = symbol.descriptor.isInline
|
isInline = symbol.descriptor.isInline,
|
||||||
|
isExpect = symbol.descriptor.isExpect
|
||||||
)
|
)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|||||||
+9
-5
@@ -37,11 +37,14 @@ class IrConstructorImpl(
|
|||||||
returnType: IrType,
|
returnType: IrType,
|
||||||
isInline: Boolean,
|
isInline: Boolean,
|
||||||
isExternal: Boolean,
|
isExternal: Boolean,
|
||||||
override val isPrimary: Boolean
|
override val isPrimary: Boolean,
|
||||||
|
isExpect: Boolean
|
||||||
) :
|
) :
|
||||||
IrFunctionBase(
|
IrFunctionBase(
|
||||||
startOffset, endOffset, origin, name,
|
startOffset, endOffset, origin, name,
|
||||||
visibility, isInline, isExternal, returnType
|
visibility,
|
||||||
|
isInline, isExternal, isExpect,
|
||||||
|
returnType
|
||||||
),
|
),
|
||||||
IrConstructor {
|
IrConstructor {
|
||||||
|
|
||||||
@@ -57,9 +60,10 @@ class IrConstructorImpl(
|
|||||||
symbol.descriptor.name,
|
symbol.descriptor.name,
|
||||||
symbol.descriptor.visibility,
|
symbol.descriptor.visibility,
|
||||||
returnType,
|
returnType,
|
||||||
symbol.descriptor.isInline,
|
isInline = symbol.descriptor.isInline,
|
||||||
symbol.descriptor.isEffectivelyExternal(),
|
isExternal = symbol.descriptor.isEffectivelyExternal(),
|
||||||
symbol.descriptor.isPrimary
|
isPrimary = symbol.descriptor.isPrimary,
|
||||||
|
isExpect = symbol.descriptor.isExpect
|
||||||
) {
|
) {
|
||||||
this.body = body
|
this.body = body
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ abstract class IrFunctionBase(
|
|||||||
override var visibility: Visibility,
|
override var visibility: Visibility,
|
||||||
override val isInline: Boolean,
|
override val isInline: Boolean,
|
||||||
override val isExternal: Boolean,
|
override val isExternal: Boolean,
|
||||||
|
override val isExpect: Boolean,
|
||||||
returnType: IrType
|
returnType: IrType
|
||||||
) :
|
) :
|
||||||
IrDeclarationBase(startOffset, endOffset, origin),
|
IrDeclarationBase(startOffset, endOffset, origin),
|
||||||
|
|||||||
@@ -31,9 +31,10 @@ class IrFunctionImpl(
|
|||||||
isInline: Boolean,
|
isInline: Boolean,
|
||||||
isExternal: Boolean,
|
isExternal: Boolean,
|
||||||
override val isTailrec: Boolean,
|
override val isTailrec: Boolean,
|
||||||
override val isSuspend: Boolean
|
override val isSuspend: Boolean,
|
||||||
|
isExpect: Boolean
|
||||||
) :
|
) :
|
||||||
IrFunctionBase(startOffset, endOffset, origin, name, visibility, isInline, isExternal, returnType),
|
IrFunctionBase(startOffset, endOffset, origin, name, visibility, isInline, isExternal, isExpect, returnType),
|
||||||
IrSimpleFunction {
|
IrSimpleFunction {
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@@ -50,10 +51,11 @@ class IrFunctionImpl(
|
|||||||
visibility,
|
visibility,
|
||||||
modality,
|
modality,
|
||||||
returnType,
|
returnType,
|
||||||
symbol.descriptor.isInline,
|
isInline = symbol.descriptor.isInline,
|
||||||
symbol.descriptor.isExternal,
|
isExternal = symbol.descriptor.isExternal,
|
||||||
symbol.descriptor.isTailrec,
|
isTailrec = symbol.descriptor.isTailrec,
|
||||||
symbol.descriptor.isSuspend
|
isSuspend = symbol.descriptor.isSuspend,
|
||||||
|
isExpect = symbol.descriptor.isExpect
|
||||||
)
|
)
|
||||||
|
|
||||||
override val descriptor: FunctionDescriptor = symbol.descriptor
|
override val descriptor: FunctionDescriptor = symbol.descriptor
|
||||||
|
|||||||
@@ -39,8 +39,9 @@ class IrPropertyImpl(
|
|||||||
override val isVar: Boolean = symbol.descriptor.isVar,
|
override val isVar: Boolean = symbol.descriptor.isVar,
|
||||||
override val isConst: Boolean = symbol.descriptor.isConst,
|
override val isConst: Boolean = symbol.descriptor.isConst,
|
||||||
override val isLateinit: Boolean = symbol.descriptor.isLateInit,
|
override val isLateinit: Boolean = symbol.descriptor.isLateInit,
|
||||||
@Suppress("DEPRECATION") override val isDelegated: Boolean = symbol.descriptor.isDelegated,
|
override val isDelegated: Boolean = @Suppress("DEPRECATION") symbol.descriptor.isDelegated,
|
||||||
override val isExternal: Boolean = symbol.descriptor.isEffectivelyExternal()
|
override val isExternal: Boolean = symbol.descriptor.isEffectivelyExternal(),
|
||||||
|
override val isExpect: Boolean = symbol.descriptor.isExpect
|
||||||
) : IrDeclarationBase(startOffset, endOffset, origin),
|
) : IrDeclarationBase(startOffset, endOffset, origin),
|
||||||
IrProperty {
|
IrProperty {
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ class IrLazyClass(
|
|||||||
override val isData: Boolean,
|
override val isData: Boolean,
|
||||||
override val isExternal: Boolean,
|
override val isExternal: Boolean,
|
||||||
override val isInline: Boolean,
|
override val isInline: Boolean,
|
||||||
|
override val isExpect: Boolean,
|
||||||
stubGenerator: DeclarationStubGenerator,
|
stubGenerator: DeclarationStubGenerator,
|
||||||
typeTranslator: TypeTranslator
|
typeTranslator: TypeTranslator
|
||||||
) :
|
) :
|
||||||
@@ -57,6 +58,7 @@ class IrLazyClass(
|
|||||||
isData = symbol.descriptor.isData,
|
isData = symbol.descriptor.isData,
|
||||||
isExternal = symbol.descriptor.isEffectivelyExternal(),
|
isExternal = symbol.descriptor.isEffectivelyExternal(),
|
||||||
isInline = symbol.descriptor.isInline,
|
isInline = symbol.descriptor.isInline,
|
||||||
|
isExpect = symbol.descriptor.isExpect,
|
||||||
stubGenerator = stubGenerator,
|
stubGenerator = stubGenerator,
|
||||||
typeTranslator = TypeTranslator
|
typeTranslator = TypeTranslator
|
||||||
)
|
)
|
||||||
|
|||||||
+8
-6
@@ -28,12 +28,13 @@ class IrLazyConstructor(
|
|||||||
isInline: Boolean,
|
isInline: Boolean,
|
||||||
isExternal: Boolean,
|
isExternal: Boolean,
|
||||||
override val isPrimary: Boolean,
|
override val isPrimary: Boolean,
|
||||||
|
isExpect: Boolean,
|
||||||
stubGenerator: DeclarationStubGenerator,
|
stubGenerator: DeclarationStubGenerator,
|
||||||
typeTranslator: TypeTranslator
|
typeTranslator: TypeTranslator
|
||||||
) :
|
) :
|
||||||
IrLazyFunctionBase(
|
IrLazyFunctionBase(
|
||||||
startOffset, endOffset, origin, name,
|
startOffset, endOffset, origin, name,
|
||||||
visibility, isInline, isExternal,
|
visibility, isInline, isExternal, isExpect,
|
||||||
stubGenerator, typeTranslator
|
stubGenerator, typeTranslator
|
||||||
),
|
),
|
||||||
IrConstructor {
|
IrConstructor {
|
||||||
@@ -49,11 +50,12 @@ class IrLazyConstructor(
|
|||||||
startOffset, endOffset, origin, symbol,
|
startOffset, endOffset, origin, symbol,
|
||||||
symbol.descriptor.name,
|
symbol.descriptor.name,
|
||||||
symbol.descriptor.visibility,
|
symbol.descriptor.visibility,
|
||||||
symbol.descriptor.isInline,
|
isInline = symbol.descriptor.isInline,
|
||||||
symbol.descriptor.isEffectivelyExternal(),
|
isExternal = symbol.descriptor.isEffectivelyExternal(),
|
||||||
symbol.descriptor.isPrimary,
|
isPrimary = symbol.descriptor.isPrimary,
|
||||||
stubGenerator,
|
isExpect = symbol.descriptor.isExpect,
|
||||||
TypeTranslator
|
stubGenerator = stubGenerator,
|
||||||
|
typeTranslator = TypeTranslator
|
||||||
)
|
)
|
||||||
|
|
||||||
override val typeParameters: MutableList<IrTypeParameter> by lazy {
|
override val typeParameters: MutableList<IrTypeParameter> by lazy {
|
||||||
|
|||||||
+13
-11
@@ -33,10 +33,11 @@ class IrLazyFunction(
|
|||||||
isExternal: Boolean,
|
isExternal: Boolean,
|
||||||
override val isTailrec: Boolean,
|
override val isTailrec: Boolean,
|
||||||
override val isSuspend: Boolean,
|
override val isSuspend: Boolean,
|
||||||
|
isExpect: Boolean,
|
||||||
stubGenerator: DeclarationStubGenerator,
|
stubGenerator: DeclarationStubGenerator,
|
||||||
typeTranslator: TypeTranslator
|
typeTranslator: TypeTranslator
|
||||||
) :
|
) :
|
||||||
IrLazyFunctionBase(startOffset, endOffset, origin, name, visibility, isInline, isExternal, stubGenerator, typeTranslator),
|
IrLazyFunctionBase(startOffset, endOffset, origin, name, visibility, isInline, isExternal, isExpect, stubGenerator, typeTranslator),
|
||||||
IrSimpleFunction {
|
IrSimpleFunction {
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@@ -51,12 +52,13 @@ class IrLazyFunction(
|
|||||||
symbol.descriptor.name,
|
symbol.descriptor.name,
|
||||||
symbol.descriptor.visibility,
|
symbol.descriptor.visibility,
|
||||||
symbol.descriptor.modality,
|
symbol.descriptor.modality,
|
||||||
symbol.descriptor.isInline,
|
isInline = symbol.descriptor.isInline,
|
||||||
symbol.descriptor.isExternal,
|
isExternal = symbol.descriptor.isExternal,
|
||||||
symbol.descriptor.isTailrec,
|
isTailrec = symbol.descriptor.isTailrec,
|
||||||
symbol.descriptor.isSuspend,
|
isSuspend = symbol.descriptor.isSuspend,
|
||||||
stubGenerator,
|
isExpect = symbol.descriptor.isExpect,
|
||||||
TypeTranslator
|
stubGenerator = stubGenerator,
|
||||||
|
typeTranslator = TypeTranslator
|
||||||
)
|
)
|
||||||
|
|
||||||
override val descriptor: FunctionDescriptor = symbol.descriptor
|
override val descriptor: FunctionDescriptor = symbol.descriptor
|
||||||
@@ -65,13 +67,13 @@ class IrLazyFunction(
|
|||||||
typeTranslator.buildWithScope(this) {
|
typeTranslator.buildWithScope(this) {
|
||||||
stubGenerator.symbolTable.withScope(descriptor) {
|
stubGenerator.symbolTable.withScope(descriptor) {
|
||||||
val propertyIfAccessor = descriptor.propertyIfAccessor
|
val propertyIfAccessor = descriptor.propertyIfAccessor
|
||||||
propertyIfAccessor.typeParameters.mapTo(arrayListOf()) {
|
propertyIfAccessor.typeParameters.mapTo(arrayListOf()) { typeParameterDescriptor ->
|
||||||
if (descriptor != propertyIfAccessor) {
|
if (descriptor != propertyIfAccessor) {
|
||||||
stubGenerator.generateOrGetScopedTypeParameterStub(it).also {
|
stubGenerator.generateOrGetScopedTypeParameterStub(typeParameterDescriptor).also { irTypeParameter ->
|
||||||
it.parent = this@IrLazyFunction
|
irTypeParameter.parent = this@IrLazyFunction
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
stubGenerator.generateOrGetTypeParameterStub(it)
|
stubGenerator.generateOrGetTypeParameterStub(typeParameterDescriptor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -26,6 +26,7 @@ abstract class IrLazyFunctionBase(
|
|||||||
override var visibility: Visibility,
|
override var visibility: Visibility,
|
||||||
override val isInline: Boolean,
|
override val isInline: Boolean,
|
||||||
override val isExternal: Boolean,
|
override val isExternal: Boolean,
|
||||||
|
override val isExpect: Boolean,
|
||||||
stubGenerator: DeclarationStubGenerator,
|
stubGenerator: DeclarationStubGenerator,
|
||||||
typeTranslator: TypeTranslator
|
typeTranslator: TypeTranslator
|
||||||
) :
|
) :
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ class IrLazyProperty(
|
|||||||
override val isLateinit: Boolean,
|
override val isLateinit: Boolean,
|
||||||
override val isDelegated: Boolean,
|
override val isDelegated: Boolean,
|
||||||
override val isExternal: Boolean,
|
override val isExternal: Boolean,
|
||||||
|
override val isExpect: Boolean,
|
||||||
stubGenerator: DeclarationStubGenerator,
|
stubGenerator: DeclarationStubGenerator,
|
||||||
typeTranslator: TypeTranslator,
|
typeTranslator: TypeTranslator,
|
||||||
private val bindingContext: BindingContext? = null
|
private val bindingContext: BindingContext? = null
|
||||||
@@ -59,6 +60,7 @@ class IrLazyProperty(
|
|||||||
isLateinit = symbol.descriptor.isLateInit,
|
isLateinit = symbol.descriptor.isLateInit,
|
||||||
isDelegated = @Suppress("DEPRECATION") symbol.descriptor.isDelegated,
|
isDelegated = @Suppress("DEPRECATION") symbol.descriptor.isDelegated,
|
||||||
isExternal = symbol.descriptor.isEffectivelyExternal(),
|
isExternal = symbol.descriptor.isEffectivelyExternal(),
|
||||||
|
isExpect = symbol.descriptor.isExpect,
|
||||||
stubGenerator = stubGenerator,
|
stubGenerator = stubGenerator,
|
||||||
typeTranslator = typeTranslator,
|
typeTranslator = typeTranslator,
|
||||||
bindingContext = bindingContext
|
bindingContext = bindingContext
|
||||||
|
|||||||
@@ -144,7 +144,8 @@ open class DeepCopyIrTreeWithSymbols(
|
|||||||
declaration.isInner,
|
declaration.isInner,
|
||||||
declaration.isData,
|
declaration.isData,
|
||||||
declaration.isExternal,
|
declaration.isExternal,
|
||||||
declaration.isInline
|
declaration.isInline,
|
||||||
|
declaration.isExpect
|
||||||
).apply {
|
).apply {
|
||||||
transformAnnotations(declaration)
|
transformAnnotations(declaration)
|
||||||
copyTypeParametersFrom(declaration)
|
copyTypeParametersFrom(declaration)
|
||||||
@@ -164,10 +165,11 @@ open class DeepCopyIrTreeWithSymbols(
|
|||||||
declaration.visibility,
|
declaration.visibility,
|
||||||
declaration.modality,
|
declaration.modality,
|
||||||
declaration.returnType,
|
declaration.returnType,
|
||||||
declaration.isInline,
|
isInline = declaration.isInline,
|
||||||
declaration.isExternal,
|
isExternal = declaration.isExternal,
|
||||||
declaration.isTailrec,
|
isTailrec = declaration.isTailrec,
|
||||||
declaration.isSuspend
|
isSuspend = declaration.isSuspend,
|
||||||
|
isExpect = declaration.isExpect
|
||||||
).apply {
|
).apply {
|
||||||
declaration.overriddenSymbols.mapTo(overriddenSymbols) {
|
declaration.overriddenSymbols.mapTo(overriddenSymbols) {
|
||||||
symbolRemapper.getReferencedFunction(it) as IrSimpleFunctionSymbol
|
symbolRemapper.getReferencedFunction(it) as IrSimpleFunctionSymbol
|
||||||
@@ -183,9 +185,10 @@ open class DeepCopyIrTreeWithSymbols(
|
|||||||
declaration.name,
|
declaration.name,
|
||||||
declaration.visibility,
|
declaration.visibility,
|
||||||
declaration.returnType,
|
declaration.returnType,
|
||||||
declaration.isInline,
|
isInline = declaration.isInline,
|
||||||
declaration.isExternal,
|
isExternal = declaration.isExternal,
|
||||||
declaration.isPrimary
|
isPrimary = declaration.isPrimary,
|
||||||
|
isExpect = declaration.isExpect
|
||||||
).apply {
|
).apply {
|
||||||
transformFunctionChildren(declaration)
|
transformFunctionChildren(declaration)
|
||||||
}
|
}
|
||||||
@@ -215,11 +218,12 @@ open class DeepCopyIrTreeWithSymbols(
|
|||||||
declaration.name,
|
declaration.name,
|
||||||
declaration.visibility,
|
declaration.visibility,
|
||||||
declaration.modality,
|
declaration.modality,
|
||||||
declaration.isVar,
|
isVar = declaration.isVar,
|
||||||
declaration.isConst,
|
isConst = declaration.isConst,
|
||||||
declaration.isLateinit,
|
isLateinit = declaration.isLateinit,
|
||||||
declaration.isDelegated,
|
isDelegated = declaration.isDelegated,
|
||||||
declaration.isExternal
|
isExpect = declaration.isExpect,
|
||||||
|
isExternal = declaration.isExternal
|
||||||
).apply {
|
).apply {
|
||||||
transformAnnotations(declaration)
|
transformAnnotations(declaration)
|
||||||
this.backingField = declaration.backingField?.transform()
|
this.backingField = declaration.backingField?.transform()
|
||||||
|
|||||||
@@ -370,7 +370,8 @@ class RenderIrElementVisitor : IrElementVisitor<String, Nothing?> {
|
|||||||
"tailrec".takeIf { isTailrec },
|
"tailrec".takeIf { isTailrec },
|
||||||
"inline".takeIf { isInline },
|
"inline".takeIf { isInline },
|
||||||
"external".takeIf { isExternal },
|
"external".takeIf { isExternal },
|
||||||
"suspend".takeIf { isSuspend }
|
"suspend".takeIf { isSuspend },
|
||||||
|
"expect".takeIf { isExpect }
|
||||||
)
|
)
|
||||||
|
|
||||||
private fun IrFunction.renderTypeParameters(): String =
|
private fun IrFunction.renderTypeParameters(): String =
|
||||||
@@ -397,7 +398,8 @@ class RenderIrElementVisitor : IrElementVisitor<String, Nothing?> {
|
|||||||
renderFlagsList(
|
renderFlagsList(
|
||||||
"inline".takeIf { isInline },
|
"inline".takeIf { isInline },
|
||||||
"external".takeIf { isExternal },
|
"external".takeIf { isExternal },
|
||||||
"primary".takeIf { isPrimary }
|
"primary".takeIf { isPrimary },
|
||||||
|
"expect".takeIf { isExpect }
|
||||||
)
|
)
|
||||||
|
|
||||||
override fun visitProperty(declaration: IrProperty, data: Nothing?): String =
|
override fun visitProperty(declaration: IrProperty, data: Nothing?): String =
|
||||||
@@ -413,6 +415,7 @@ class RenderIrElementVisitor : IrElementVisitor<String, Nothing?> {
|
|||||||
"const".takeIf { isConst },
|
"const".takeIf { isConst },
|
||||||
"lateinit".takeIf { isLateinit },
|
"lateinit".takeIf { isLateinit },
|
||||||
"delegated".takeIf { isDelegated },
|
"delegated".takeIf { isDelegated },
|
||||||
|
"expect".takeIf { isExpect },
|
||||||
if (isVar) "var" else "val"
|
if (isVar) "var" else "val"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -443,7 +446,8 @@ class RenderIrElementVisitor : IrElementVisitor<String, Nothing?> {
|
|||||||
"inner".takeIf { isInner },
|
"inner".takeIf { isInner },
|
||||||
"data".takeIf { isData },
|
"data".takeIf { isData },
|
||||||
"external".takeIf { isExternal },
|
"external".takeIf { isExternal },
|
||||||
"inline".takeIf { isInline }
|
"inline".takeIf { isInline },
|
||||||
|
"expect".takeIf { isExpect }
|
||||||
)
|
)
|
||||||
|
|
||||||
override fun visitVariable(declaration: IrVariable, data: Nothing?): String =
|
override fun visitVariable(declaration: IrVariable, data: Nothing?): String =
|
||||||
|
|||||||
+7
-7
@@ -1,8 +1,8 @@
|
|||||||
FILE fqName:<root> fileName:/expectClassInherited.kt
|
FILE fqName:<root> fileName:/expectClassInherited.kt
|
||||||
CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
|
CLASS CLASS name:A modality:ABSTRACT visibility:public [expect] superTypes:[kotlin.Any]
|
||||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.A
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.A
|
||||||
CONSTRUCTOR visibility:protected <> () returnType:<root>.A [primary]
|
CONSTRUCTOR visibility:protected <> () returnType:<root>.A [primary,expect]
|
||||||
FUN name:foo visibility:public modality:ABSTRACT <> ($this:<root>.A) returnType:kotlin.Unit
|
FUN name:foo visibility:public modality:ABSTRACT <> ($this:<root>.A) returnType:kotlin.Unit [expect]
|
||||||
$this: VALUE_PARAMETER name:<this> type:<root>.A
|
$this: VALUE_PARAMETER name:<this> type:<root>.A
|
||||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
|
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
|
||||||
overridden:
|
overridden:
|
||||||
@@ -17,15 +17,15 @@ FILE fqName:<root> fileName:/expectClassInherited.kt
|
|||||||
overridden:
|
overridden:
|
||||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||||
CLASS CLASS name:B modality:OPEN visibility:public superTypes:[<root>.A]
|
CLASS CLASS name:B modality:OPEN visibility:public [expect] superTypes:[<root>.A]
|
||||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.B
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.B
|
||||||
CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:<root>.B [primary]
|
CONSTRUCTOR visibility:public <> (i:kotlin.Int) returnType:<root>.B [primary,expect]
|
||||||
VALUE_PARAMETER name:i index:0 type:kotlin.Int
|
VALUE_PARAMETER name:i index:0 type:kotlin.Int
|
||||||
FUN name:foo visibility:public modality:OPEN <> ($this:<root>.B) returnType:kotlin.Unit
|
FUN name:foo visibility:public modality:OPEN <> ($this:<root>.B) returnType:kotlin.Unit [expect]
|
||||||
overridden:
|
overridden:
|
||||||
public abstract fun foo (): kotlin.Unit declared in <root>.A
|
public abstract fun foo (): kotlin.Unit declared in <root>.A
|
||||||
$this: VALUE_PARAMETER name:<this> type:<root>.B
|
$this: VALUE_PARAMETER name:<this> type:<root>.B
|
||||||
FUN name:bar visibility:public modality:OPEN <> ($this:<root>.B, s:kotlin.String) returnType:kotlin.Unit
|
FUN name:bar visibility:public modality:OPEN <> ($this:<root>.B, s:kotlin.String) returnType:kotlin.Unit [expect]
|
||||||
$this: VALUE_PARAMETER name:<this> type:<root>.B
|
$this: VALUE_PARAMETER name:<this> type:<root>.B
|
||||||
VALUE_PARAMETER name:s index:0 type:kotlin.String
|
VALUE_PARAMETER name:s index:0 type:kotlin.String
|
||||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
|
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
FILE fqName:<root> fileName:/expectedEnumClass.kt
|
FILE fqName:<root> fileName:/expectedEnumClass.kt
|
||||||
CLASS ENUM_CLASS name:MyEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.MyEnum>]
|
CLASS ENUM_CLASS name:MyEnum modality:FINAL visibility:public [expect] superTypes:[kotlin.Enum<<root>.MyEnum>]
|
||||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyEnum
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyEnum
|
||||||
ENUM_ENTRY name:FOO
|
ENUM_ENTRY name:FOO
|
||||||
ENUM_ENTRY name:BAR
|
ENUM_ENTRY name:BAR
|
||||||
|
|||||||
+4
-4
@@ -1,7 +1,7 @@
|
|||||||
FILE fqName:<root> fileName:/expectedSealedClass.kt
|
FILE fqName:<root> fileName:/expectedSealedClass.kt
|
||||||
CLASS CLASS name:Ops modality:SEALED visibility:public superTypes:[kotlin.Any]
|
CLASS CLASS name:Ops modality:SEALED visibility:public [expect] superTypes:[kotlin.Any]
|
||||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Ops
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Ops
|
||||||
CONSTRUCTOR visibility:private <> () returnType:<root>.Ops [primary]
|
CONSTRUCTOR visibility:private <> () returnType:<root>.Ops [primary,expect]
|
||||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
|
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
|
||||||
overridden:
|
overridden:
|
||||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
|
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
|
||||||
@@ -15,9 +15,9 @@ FILE fqName:<root> fileName:/expectedSealedClass.kt
|
|||||||
overridden:
|
overridden:
|
||||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||||
CLASS CLASS name:Add modality:FINAL visibility:public superTypes:[<root>.Ops]
|
CLASS CLASS name:Add modality:FINAL visibility:public [expect] superTypes:[<root>.Ops]
|
||||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Add
|
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Add
|
||||||
CONSTRUCTOR visibility:public <> () returnType:<root>.Add [primary]
|
CONSTRUCTOR visibility:public <> () returnType:<root>.Add [primary,expect]
|
||||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
|
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
|
||||||
overridden:
|
overridden:
|
||||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.Ops
|
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.Ops
|
||||||
|
|||||||
Reference in New Issue
Block a user