[FIR2IR] Remove some descriptor-around calls
This commit is contained in:
@@ -43,7 +43,6 @@ import org.jetbrains.kotlin.ir.symbols.IrSymbol
|
|||||||
import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol
|
import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol
|
||||||
import org.jetbrains.kotlin.ir.symbols.IrValueSymbol
|
import org.jetbrains.kotlin.ir.symbols.IrValueSymbol
|
||||||
import org.jetbrains.kotlin.ir.expressions.impl.IrConstImpl
|
import org.jetbrains.kotlin.ir.expressions.impl.IrConstImpl
|
||||||
import org.jetbrains.kotlin.ir.symbols.*
|
|
||||||
import org.jetbrains.kotlin.ir.symbols.impl.IrClassPublicSymbolImpl
|
import org.jetbrains.kotlin.ir.symbols.impl.IrClassPublicSymbolImpl
|
||||||
import org.jetbrains.kotlin.ir.symbols.impl.IrClassSymbolImpl
|
import org.jetbrains.kotlin.ir.symbols.impl.IrClassSymbolImpl
|
||||||
import org.jetbrains.kotlin.ir.types.*
|
import org.jetbrains.kotlin.ir.types.*
|
||||||
@@ -503,7 +502,11 @@ fun Fir2IrComponents.createSafeCallConstruction(
|
|||||||
statements += receiverVariable
|
statements += receiverVariable
|
||||||
statements += IrWhenImpl(startOffset, endOffset, resultType).apply {
|
statements += IrWhenImpl(startOffset, endOffset, resultType).apply {
|
||||||
val condition = IrCallImpl(
|
val condition = IrCallImpl(
|
||||||
startOffset, endOffset, irBuiltIns.booleanType, irBuiltIns.eqeqSymbol, origin = IrStatementOrigin.EQEQ
|
startOffset, endOffset, irBuiltIns.booleanType,
|
||||||
|
irBuiltIns.eqeqSymbol,
|
||||||
|
valueArgumentsCount = 2,
|
||||||
|
typeArgumentsCount = 0,
|
||||||
|
origin = IrStatementOrigin.EQEQ
|
||||||
).apply {
|
).apply {
|
||||||
putValueArgument(0, IrGetValueImpl(startOffset, endOffset, receiverVariableSymbol))
|
putValueArgument(0, IrGetValueImpl(startOffset, endOffset, receiverVariableSymbol))
|
||||||
putValueArgument(1, IrConstImpl.constNull(startOffset, endOffset, irBuiltIns.nothingNType))
|
putValueArgument(1, IrConstImpl.constNull(startOffset, endOffset, irBuiltIns.nothingNType))
|
||||||
@@ -526,7 +529,7 @@ fun Fir2IrComponents.createTemporaryVariableForSafeCallConstruction(
|
|||||||
val receiverVariable = declarationStorage.declareTemporaryVariable(receiverExpression, "safe_receiver").apply {
|
val receiverVariable = declarationStorage.declareTemporaryVariable(receiverExpression, "safe_receiver").apply {
|
||||||
parent = conversionScope.parentFromStack()
|
parent = conversionScope.parentFromStack()
|
||||||
}
|
}
|
||||||
val variableSymbol = symbolTable.referenceValue(receiverVariable.descriptor)
|
val variableSymbol = receiverVariable.symbol
|
||||||
|
|
||||||
return Pair(receiverVariable, variableSymbol)
|
return Pair(receiverVariable, variableSymbol)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -230,8 +230,7 @@ class Fir2IrClassifierStorage(
|
|||||||
isExpect = regularClass.isExpect,
|
isExpect = regularClass.isExpect,
|
||||||
isFun = regularClass.isFun
|
isFun = regularClass.isFun
|
||||||
).apply {
|
).apply {
|
||||||
val descriptor = symbol.descriptor
|
metadata = FirMetadataSource.Class(regularClass)
|
||||||
metadata = FirMetadataSource.Class(regularClass, descriptor as WrappedClassDescriptor)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -263,8 +262,7 @@ class Fir2IrClassifierStorage(
|
|||||||
anonymousObject.classKind.takeIf { it == ClassKind.ENUM_ENTRY } ?: ClassKind.CLASS,
|
anonymousObject.classKind.takeIf { it == ClassKind.ENUM_ENTRY } ?: ClassKind.CLASS,
|
||||||
visibility, modality
|
visibility, modality
|
||||||
).apply {
|
).apply {
|
||||||
val descriptor = symbol.descriptor
|
metadata = FirMetadataSource.Class(anonymousObject)
|
||||||
metadata = FirMetadataSource.Class(anonymousObject, descriptor as WrappedClassDescriptor)
|
|
||||||
setThisReceiver(anonymousObject.typeParameters)
|
setThisReceiver(anonymousObject.typeParameters)
|
||||||
if (irParent != null) {
|
if (irParent != null) {
|
||||||
this.parent = irParent
|
this.parent = irParent
|
||||||
@@ -388,8 +386,13 @@ class Fir2IrClassifierStorage(
|
|||||||
|
|
||||||
this.correspondingClass = klass
|
this.correspondingClass = klass
|
||||||
} else if (irParent != null && origin == IrDeclarationOrigin.DEFINED) {
|
} else if (irParent != null && origin == IrDeclarationOrigin.DEFINED) {
|
||||||
|
val constructor = irParent.constructors.first()
|
||||||
this.initializerExpression = IrExpressionBodyImpl(
|
this.initializerExpression = IrExpressionBodyImpl(
|
||||||
IrEnumConstructorCallImpl(startOffset, endOffset, irType, irParent.constructors.first().symbol)
|
IrEnumConstructorCallImpl(
|
||||||
|
startOffset, endOffset, irType, constructor.symbol,
|
||||||
|
valueArgumentsCount = constructor.valueParameters.size,
|
||||||
|
typeArgumentsCount = constructor.typeParameters.size
|
||||||
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
declarationStorage.leaveScope(this)
|
declarationStorage.leaveScope(this)
|
||||||
|
|||||||
+3
-3
@@ -476,7 +476,7 @@ class Fir2IrDeclarationStorage(
|
|||||||
isFakeOverride = updatedOrigin == IrDeclarationOrigin.FAKE_OVERRIDE,
|
isFakeOverride = updatedOrigin == IrDeclarationOrigin.FAKE_OVERRIDE,
|
||||||
isOperator = simpleFunction?.isOperator == true
|
isOperator = simpleFunction?.isOperator == true
|
||||||
).apply {
|
).apply {
|
||||||
metadata = FirMetadataSource.Function(function, descriptor)
|
metadata = FirMetadataSource.Function(function)
|
||||||
enterScope(this)
|
enterScope(this)
|
||||||
bindAndDeclareParameters(
|
bindAndDeclareParameters(
|
||||||
function, irParent,
|
function, irParent,
|
||||||
@@ -545,7 +545,7 @@ class Fir2IrDeclarationStorage(
|
|||||||
constructor.returnTypeRef.toIrType(),
|
constructor.returnTypeRef.toIrType(),
|
||||||
isInline = false, isExternal = false, isPrimary = isPrimary, isExpect = false
|
isInline = false, isExternal = false, isPrimary = isPrimary, isExpect = false
|
||||||
).apply {
|
).apply {
|
||||||
metadata = FirMetadataSource.Function(constructor, descriptor)
|
metadata = FirMetadataSource.Function(constructor)
|
||||||
enterScope(this)
|
enterScope(this)
|
||||||
bindAndDeclareParameters(constructor, irParent, isStatic = false)
|
bindAndDeclareParameters(constructor, irParent, isStatic = false)
|
||||||
leaveScope(this)
|
leaveScope(this)
|
||||||
@@ -601,7 +601,7 @@ class Fir2IrDeclarationStorage(
|
|||||||
isOperator = false
|
isOperator = false
|
||||||
).apply {
|
).apply {
|
||||||
if (propertyAccessor != null) {
|
if (propertyAccessor != null) {
|
||||||
metadata = FirMetadataSource.Function(propertyAccessor, descriptor)
|
metadata = FirMetadataSource.Function(propertyAccessor)
|
||||||
}
|
}
|
||||||
with(classifierStorage) {
|
with(classifierStorage) {
|
||||||
setTypeParameters(
|
setTypeParameters(
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ class Fir2IrVisitor(
|
|||||||
|
|
||||||
private val memberGenerator = ClassMemberGenerator(components, this, conversionScope, callGenerator, fakeOverrideMode)
|
private val memberGenerator = ClassMemberGenerator(components, this, conversionScope, callGenerator, fakeOverrideMode)
|
||||||
|
|
||||||
private val operatorGenerator = OperatorExpressionGenerator(components, this, callGenerator, conversionScope)
|
private val operatorGenerator = OperatorExpressionGenerator(components, this, conversionScope)
|
||||||
|
|
||||||
private fun FirTypeRef.toIrType(): IrType = with(typeConverter) { toIrType() }
|
private fun FirTypeRef.toIrType(): IrType = with(typeConverter) { toIrType() }
|
||||||
|
|
||||||
@@ -106,10 +106,13 @@ class Fir2IrVisitor(
|
|||||||
converter.processAnonymousObjectMembers(enumEntry.initializer as FirAnonymousObject, correspondingClass)
|
converter.processAnonymousObjectMembers(enumEntry.initializer as FirAnonymousObject, correspondingClass)
|
||||||
conversionScope.withParent(correspondingClass) {
|
conversionScope.withParent(correspondingClass) {
|
||||||
memberGenerator.convertClassContent(correspondingClass, enumEntry.initializer as FirAnonymousObject)
|
memberGenerator.convertClassContent(correspondingClass, enumEntry.initializer as FirAnonymousObject)
|
||||||
|
val constructor = correspondingClass.constructors.first()
|
||||||
irEnumEntry.initializerExpression = IrExpressionBodyImpl(
|
irEnumEntry.initializerExpression = IrExpressionBodyImpl(
|
||||||
IrEnumConstructorCallImpl(
|
IrEnumConstructorCallImpl(
|
||||||
startOffset, endOffset, enumEntry.returnTypeRef.toIrType(),
|
startOffset, endOffset, enumEntry.returnTypeRef.toIrType(),
|
||||||
correspondingClass.constructors.first().symbol
|
constructor.symbol,
|
||||||
|
typeArgumentsCount = constructor.typeParameters.size,
|
||||||
|
valueArgumentsCount = constructor.valueParameters.size
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -598,7 +601,10 @@ class Fir2IrVisitor(
|
|||||||
}
|
}
|
||||||
if (whenExpression.isExhaustive && !unconditionalBranchFound) {
|
if (whenExpression.isExhaustive && !unconditionalBranchFound) {
|
||||||
val irResult = IrCallImpl(
|
val irResult = IrCallImpl(
|
||||||
startOffset, endOffset, irBuiltIns.nothingType, irBuiltIns.noWhenBranchMatchedExceptionSymbol
|
startOffset, endOffset, irBuiltIns.nothingType,
|
||||||
|
irBuiltIns.noWhenBranchMatchedExceptionSymbol,
|
||||||
|
typeArgumentsCount = 0,
|
||||||
|
valueArgumentsCount = 0
|
||||||
)
|
)
|
||||||
branches += IrElseBranchImpl(
|
branches += IrElseBranchImpl(
|
||||||
IrConstImpl.boolean(startOffset, endOffset, irBuiltIns.booleanType, true), irResult
|
IrConstImpl.boolean(startOffset, endOffset, irBuiltIns.booleanType, true), irResult
|
||||||
@@ -757,7 +763,9 @@ class Fir2IrVisitor(
|
|||||||
startOffset, endOffset,
|
startOffset, endOffset,
|
||||||
checkNotNullCall.typeRef.toIrType(),
|
checkNotNullCall.typeRef.toIrType(),
|
||||||
irBuiltIns.checkNotNullSymbol,
|
irBuiltIns.checkNotNullSymbol,
|
||||||
IrStatementOrigin.EXCLEXCL
|
typeArgumentsCount = 1,
|
||||||
|
valueArgumentsCount = 1,
|
||||||
|
origin = IrStatementOrigin.EXCLEXCL
|
||||||
).apply {
|
).apply {
|
||||||
putTypeArgument(0, checkNotNullCall.argument.typeRef.toIrType().makeNotNull())
|
putTypeArgument(0, checkNotNullCall.argument.typeRef.toIrType().makeNotNull())
|
||||||
putValueArgument(0, convertToIrExpression(checkNotNullCall.argument))
|
putValueArgument(0, convertToIrExpression(checkNotNullCall.argument))
|
||||||
|
|||||||
@@ -5,13 +5,10 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.fir.backend
|
package org.jetbrains.kotlin.fir.backend
|
||||||
|
|
||||||
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
|
||||||
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
|
|
||||||
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
|
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
|
||||||
import org.jetbrains.kotlin.fir.FirSession
|
import org.jetbrains.kotlin.fir.FirSession
|
||||||
import org.jetbrains.kotlin.fir.declarations.*
|
import org.jetbrains.kotlin.fir.declarations.*
|
||||||
import org.jetbrains.kotlin.ir.declarations.MetadataSource
|
import org.jetbrains.kotlin.ir.declarations.MetadataSource
|
||||||
import org.jetbrains.kotlin.ir.descriptors.WrappedClassDescriptor
|
|
||||||
|
|
||||||
interface FirMetadataSource : MetadataSource {
|
interface FirMetadataSource : MetadataSource {
|
||||||
|
|
||||||
@@ -22,15 +19,15 @@ interface FirMetadataSource : MetadataSource {
|
|||||||
) : MetadataSource.File(emptyList()), FirMetadataSource
|
) : MetadataSource.File(emptyList()), FirMetadataSource
|
||||||
|
|
||||||
class Class(
|
class Class(
|
||||||
val klass: FirClass<*>, descriptor: WrappedClassDescriptor
|
val klass: FirClass<*>
|
||||||
) : MetadataSource.Class(descriptor), FirMetadataSource {
|
) : FirMetadataSource {
|
||||||
override val session: FirSession
|
override val session: FirSession
|
||||||
get() = klass.session
|
get() = klass.session
|
||||||
}
|
}
|
||||||
|
|
||||||
class Function(
|
class Function(
|
||||||
val function: FirFunction<*>, descriptor: FunctionDescriptor
|
val function: FirFunction<*>
|
||||||
) : MetadataSource.Function(descriptor), FirMetadataSource {
|
) : FirMetadataSource {
|
||||||
override val session: FirSession
|
override val session: FirSession
|
||||||
get() = function.session
|
get() = function.session
|
||||||
}
|
}
|
||||||
|
|||||||
+28
-5
@@ -81,13 +81,16 @@ internal class CallAndReferenceGenerator(
|
|||||||
IrFunctionReferenceImpl(
|
IrFunctionReferenceImpl(
|
||||||
startOffset, endOffset, type, symbol,
|
startOffset, endOffset, type, symbol,
|
||||||
typeArgumentsCount = constructor.typeParameters.size + (klass?.typeParameters?.size ?: 0),
|
typeArgumentsCount = constructor.typeParameters.size + (klass?.typeParameters?.size ?: 0),
|
||||||
|
valueArgumentsCount = constructor.valueParameters.size,
|
||||||
reflectionTarget = symbol
|
reflectionTarget = symbol
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
is IrFunctionSymbol -> {
|
is IrFunctionSymbol -> {
|
||||||
|
val function = symbol.owner
|
||||||
IrFunctionReferenceImpl(
|
IrFunctionReferenceImpl(
|
||||||
startOffset, endOffset, type, symbol,
|
startOffset, endOffset, type, symbol,
|
||||||
typeArgumentsCount = symbol.owner.typeParameters.size,
|
typeArgumentsCount = function.typeParameters.size,
|
||||||
|
valueArgumentsCount = function.valueParameters.size,
|
||||||
reflectionTarget = symbol
|
reflectionTarget = symbol
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -159,6 +162,8 @@ internal class CallAndReferenceGenerator(
|
|||||||
is IrSimpleFunctionSymbol -> {
|
is IrSimpleFunctionSymbol -> {
|
||||||
IrCallImpl(
|
IrCallImpl(
|
||||||
startOffset, endOffset, type, symbol,
|
startOffset, endOffset, type, symbol,
|
||||||
|
typeArgumentsCount = symbol.owner.typeParameters.size,
|
||||||
|
valueArgumentsCount = symbol.owner.valueParameters.size,
|
||||||
origin = qualifiedAccess.calleeReference.statementOrigin(),
|
origin = qualifiedAccess.calleeReference.statementOrigin(),
|
||||||
superQualifierSymbol = superQualifierSymbol
|
superQualifierSymbol = superQualifierSymbol
|
||||||
)
|
)
|
||||||
@@ -168,7 +173,10 @@ internal class CallAndReferenceGenerator(
|
|||||||
val backingField = symbol.owner.backingField
|
val backingField = symbol.owner.backingField
|
||||||
when {
|
when {
|
||||||
getter != null -> IrCallImpl(
|
getter != null -> IrCallImpl(
|
||||||
startOffset, endOffset, type, getter.symbol, origin = IrStatementOrigin.GET_PROPERTY,
|
startOffset, endOffset, type, getter.symbol,
|
||||||
|
typeArgumentsCount = getter.typeParameters.size,
|
||||||
|
valueArgumentsCount = 0,
|
||||||
|
origin = IrStatementOrigin.GET_PROPERTY,
|
||||||
superQualifierSymbol = superQualifierSymbol
|
superQualifierSymbol = superQualifierSymbol
|
||||||
)
|
)
|
||||||
backingField != null -> IrGetFieldImpl(
|
backingField != null -> IrGetFieldImpl(
|
||||||
@@ -213,7 +221,12 @@ internal class CallAndReferenceGenerator(
|
|||||||
val setter = irProperty.setter
|
val setter = irProperty.setter
|
||||||
val backingField = irProperty.backingField
|
val backingField = irProperty.backingField
|
||||||
when {
|
when {
|
||||||
setter != null -> IrCallImpl(startOffset, endOffset, type, setter.symbol, origin).apply {
|
setter != null -> IrCallImpl(
|
||||||
|
startOffset, endOffset, type, setter.symbol,
|
||||||
|
typeArgumentsCount = setter.typeParameters.size,
|
||||||
|
valueArgumentsCount = 1,
|
||||||
|
origin = origin
|
||||||
|
).apply {
|
||||||
putValueArgument(0, assignedValue)
|
putValueArgument(0, assignedValue)
|
||||||
}
|
}
|
||||||
backingField != null -> IrSetFieldImpl(startOffset, endOffset, backingField.symbol, type).apply {
|
backingField != null -> IrSetFieldImpl(startOffset, endOffset, backingField.symbol, type).apply {
|
||||||
@@ -224,7 +237,12 @@ internal class CallAndReferenceGenerator(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
is IrSimpleFunctionSymbol -> {
|
is IrSimpleFunctionSymbol -> {
|
||||||
IrCallImpl(startOffset, endOffset, type, symbol, origin).apply {
|
IrCallImpl(
|
||||||
|
startOffset, endOffset, type, symbol,
|
||||||
|
typeArgumentsCount = symbol.owner.typeParameters.size,
|
||||||
|
valueArgumentsCount = 1,
|
||||||
|
origin = origin
|
||||||
|
).apply {
|
||||||
putValueArgument(0, assignedValue)
|
putValueArgument(0, assignedValue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -250,7 +268,12 @@ internal class CallAndReferenceGenerator(
|
|||||||
if (irConstructor == null) {
|
if (irConstructor == null) {
|
||||||
IrErrorCallExpressionImpl(startOffset, endOffset, type, "No annotation constructor found: ${irClass.name}")
|
IrErrorCallExpressionImpl(startOffset, endOffset, type, "No annotation constructor found: ${irClass.name}")
|
||||||
} else {
|
} else {
|
||||||
IrConstructorCallImpl.fromSymbolDescriptor(startOffset, endOffset, type, irConstructor)
|
IrConstructorCallImpl(
|
||||||
|
startOffset, endOffset, type, irConstructor,
|
||||||
|
valueArgumentsCount = irConstructor.owner.valueParameters.size,
|
||||||
|
typeArgumentsCount = 0,
|
||||||
|
constructorTypeArgumentsCount = 0
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-5
@@ -211,9 +211,9 @@ internal class ClassMemberGenerator(
|
|||||||
conversionScope.withParent(this) {
|
conversionScope.withParent(this) {
|
||||||
declarationStorage.enterScope(this)
|
declarationStorage.enterScope(this)
|
||||||
val backingField = correspondingProperty.backingField
|
val backingField = correspondingProperty.backingField
|
||||||
val fieldSymbol = symbolTable.referenceField(correspondingProperty.descriptor)
|
val fieldSymbol = backingField?.symbol
|
||||||
val declaration = this
|
val declaration = this
|
||||||
if (backingField != null) {
|
if (fieldSymbol != null) {
|
||||||
body = IrBlockBodyImpl(
|
body = IrBlockBodyImpl(
|
||||||
startOffset, endOffset,
|
startOffset, endOffset,
|
||||||
listOf(
|
listOf(
|
||||||
@@ -260,12 +260,14 @@ internal class ClassMemberGenerator(
|
|||||||
return convertWithOffsets { startOffset, endOffset ->
|
return convertWithOffsets { startOffset, endOffset ->
|
||||||
val irConstructorSymbol = declarationStorage.getIrFunctionSymbol(constructorSymbol) as IrConstructorSymbol
|
val irConstructorSymbol = declarationStorage.getIrFunctionSymbol(constructorSymbol) as IrConstructorSymbol
|
||||||
if (constructorSymbol.fir.isFromEnumClass || constructorSymbol.fir.returnTypeRef.isEnum) {
|
if (constructorSymbol.fir.isFromEnumClass || constructorSymbol.fir.returnTypeRef.isEnum) {
|
||||||
|
val typeArguments = (constructedTypeRef as? FirResolvedTypeRef)?.type?.typeArguments
|
||||||
IrEnumConstructorCallImpl(
|
IrEnumConstructorCallImpl(
|
||||||
startOffset, endOffset,
|
startOffset, endOffset,
|
||||||
constructedIrType,
|
constructedIrType,
|
||||||
irConstructorSymbol
|
irConstructorSymbol,
|
||||||
|
typeArgumentsCount = typeArguments?.size ?: 0,
|
||||||
|
valueArgumentsCount = constructorSymbol.fir.valueParameters.size
|
||||||
).apply {
|
).apply {
|
||||||
val typeArguments = (constructedTypeRef as? FirResolvedTypeRef)?.type?.typeArguments
|
|
||||||
if (typeArguments?.isNotEmpty() == true) {
|
if (typeArguments?.isNotEmpty() == true) {
|
||||||
val irType = (typeArguments.first() as ConeKotlinTypeProjection).type.toIrType()
|
val irType = (typeArguments.first() as ConeKotlinTypeProjection).type.toIrType()
|
||||||
putTypeArgument(0, irType)
|
putTypeArgument(0, irType)
|
||||||
@@ -275,7 +277,9 @@ internal class ClassMemberGenerator(
|
|||||||
IrDelegatingConstructorCallImpl(
|
IrDelegatingConstructorCallImpl(
|
||||||
startOffset, endOffset,
|
startOffset, endOffset,
|
||||||
constructedIrType,
|
constructedIrType,
|
||||||
irConstructorSymbol
|
irConstructorSymbol,
|
||||||
|
valueArgumentsCount = irConstructorSymbol.owner.valueParameters.size,
|
||||||
|
typeArgumentsCount = irConstructorSymbol.owner.typeParameters.size
|
||||||
)
|
)
|
||||||
}.let {
|
}.let {
|
||||||
if (firDispatchReceiver !is FirNoReceiverExpression) {
|
if (firDispatchReceiver !is FirNoReceiverExpression) {
|
||||||
|
|||||||
+1
-2
@@ -264,8 +264,7 @@ class DataClassMembersGenerator(val components: Fir2IrComponents) {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
descriptor
|
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-2
@@ -25,7 +25,6 @@ import org.jetbrains.kotlin.ir.util.getSimpleFunction
|
|||||||
internal class OperatorExpressionGenerator(
|
internal class OperatorExpressionGenerator(
|
||||||
private val components: Fir2IrComponents,
|
private val components: Fir2IrComponents,
|
||||||
private val visitor: Fir2IrVisitor,
|
private val visitor: Fir2IrVisitor,
|
||||||
private val callGenerator: CallAndReferenceGenerator,
|
|
||||||
private val conversionScope: Fir2IrConversionScope
|
private val conversionScope: Fir2IrConversionScope
|
||||||
) : Fir2IrComponents by components {
|
) : Fir2IrComponents by components {
|
||||||
|
|
||||||
@@ -156,7 +155,13 @@ internal class OperatorExpressionGenerator(
|
|||||||
?: throw AssertionError("No conversion function for $operandType ~> $targetType")
|
?: throw AssertionError("No conversion function for $operandType ~> $targetType")
|
||||||
|
|
||||||
val dispatchReceiver = this@asComparisonOperand
|
val dispatchReceiver = this@asComparisonOperand
|
||||||
val unsafeIrCall = IrCallImpl(startOffset, endOffset, conversionFunction.owner.returnType, conversionFunction).also {
|
val unsafeIrCall = IrCallImpl(
|
||||||
|
startOffset, endOffset,
|
||||||
|
conversionFunction.owner.returnType,
|
||||||
|
conversionFunction,
|
||||||
|
valueArgumentsCount = 0,
|
||||||
|
typeArgumentsCount = 0
|
||||||
|
).also {
|
||||||
it.dispatchReceiver = dispatchReceiver
|
it.dispatchReceiver = dispatchReceiver
|
||||||
}
|
}
|
||||||
return if (operandType.isNullable) {
|
return if (operandType.isNullable) {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
// !LANGUAGE: +MultiPlatformProjects
|
// !LANGUAGE: +MultiPlatformProjects
|
||||||
// !USE_EXPERIMENTAL: kotlin.ExperimentalMultiplatform
|
// !USE_EXPERIMENTAL: kotlin.ExperimentalMultiplatform
|
||||||
// IGNORE_BACKEND: NATIVE
|
// IGNORE_BACKEND: NATIVE
|
||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// MODULE: library
|
// MODULE: library
|
||||||
// FILE: expected.kt
|
// FILE: expected.kt
|
||||||
|
|||||||
Reference in New Issue
Block a user