[JS IR BE] Make kotlinx.io compile
- Fix expect/actual default arguments - Fix dynamic type in inliner - Fix external varargs
This commit is contained in:
@@ -87,7 +87,7 @@ private val moveBodilessDeclarationsToSeparatePlacePhase = makeCustomJsModulePha
|
||||
)
|
||||
|
||||
private val expectDeclarationsRemovingPhase = makeJsModulePhase(
|
||||
::ExpectDeclarationsRemoving,
|
||||
::ExpectDeclarationsRemoveLowering,
|
||||
name = "ExpectDeclarationsRemoving",
|
||||
description = "Remove expect declaration from module fragment"
|
||||
)
|
||||
|
||||
+4
-2
@@ -157,8 +157,10 @@ internal class DeepCopyIrTreeWithSymbolsForInliner(
|
||||
if (type !is IrSimpleType) return type
|
||||
|
||||
val substitutedType = typeArguments?.get(type.classifier)
|
||||
if (substitutedType != null) {
|
||||
substitutedType as IrSimpleType
|
||||
|
||||
if (substitutedType is IrDynamicType) return substitutedType
|
||||
|
||||
if (substitutedType is IrSimpleType) {
|
||||
return substitutedType.buildSimpleType {
|
||||
kotlinType = null
|
||||
hasQuestionMark = type.hasQuestionMark or substitutedType.isMarkedNullable()
|
||||
|
||||
+4
-1
@@ -282,6 +282,8 @@ class IrElementToJsExpressionTransformer : BaseIrElementToJsNodeTransformer<JsEx
|
||||
JsInvocation(
|
||||
// Create scope for temporary variable holding dispatch receiver
|
||||
// It is used both during method reference and passing `this` value to `apply` function.
|
||||
JsNameRef(
|
||||
"call",
|
||||
JsFunction(
|
||||
context.currentScope,
|
||||
JsBlock(
|
||||
@@ -297,7 +299,8 @@ class IrElementToJsExpressionTransformer : BaseIrElementToJsNodeTransformer<JsEx
|
||||
)
|
||||
),
|
||||
"VarargIIFE"
|
||||
)
|
||||
)),
|
||||
JsThisRef()
|
||||
)
|
||||
} else {
|
||||
JsInvocation(
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@ fun translateCallArguments(expression: IrMemberAccessExpression, context: JsGene
|
||||
val argument = expression.getValueArgument(index)
|
||||
val result = argument?.accept(transformer, context)
|
||||
if (result == null) {
|
||||
assert(expression is IrFunctionAccessExpression && expression.symbol.owner.isEffectivelyExternal())
|
||||
require(expression is IrFunctionAccessExpression && expression.symbol.owner.isEffectivelyExternal())
|
||||
JsPrefixOperation(JsUnaryOperator.VOID, JsIntLiteral(1))
|
||||
} else
|
||||
result
|
||||
|
||||
Reference in New Issue
Block a user