[JS IR] Don't assume a single constructor in the Char class

This commit is contained in:
Sergej Jaskiewicz
2021-11-16 13:49:43 +03:00
committed by Space
parent a6fd14d4e6
commit 756b58d5ce
2 changed files with 1 additions and 2 deletions
@@ -192,7 +192,6 @@ class JsIntrinsics(private val irBuiltIns: IrBuiltIns, val context: JsIrBackendC
}!!
val charClassSymbol = getInternalClassWithoutPackage("kotlin.Char")
val charConstructor = charClassSymbol.constructors.single().owner
val stringClassSymbol = getInternalClassWithoutPackage("kotlin.String")
val stringConstructorSymbol = stringClassSymbol.constructors.single()
@@ -31,7 +31,7 @@ class ConstTransformer(private val context: JsIrBackendContext) : IrElementTrans
carrierFactory: (Int, Int, IrType, C) -> IrExpression,
vararg args: C
): IrExpression {
val constructor = irClass.constructors.single()
val constructor = irClass.constructors.single { it.owner.isPrimary }
val argType = constructor.owner.valueParameters.first().type
return IrConstructorCallImpl.fromSymbolOwner(irClass.defaultType, constructor).apply {
for (i in args.indices) {